- Release for 7.0.3 patch.
- Major Framework update. - Nick-Tag library upodate.
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details
|
||||
## Notes: Computes detailed infos about combats.
|
||||
## SavedVariables: _detalhes_global
|
||||
|
||||
+90
-91
@@ -16,7 +16,18 @@ local loadstring = loadstring --> lua local
|
||||
|
||||
local cleanfunction = function() end
|
||||
local APIButtonFunctions = false
|
||||
local ButtonMetaFunctions = {}
|
||||
|
||||
do
|
||||
local metaPrototype = {
|
||||
WidgetType = "button",
|
||||
SetHook = DF.SetHook,
|
||||
RunHooksForWidget = DF.RunHooksForWidget,
|
||||
}
|
||||
|
||||
_G [DF.GlobalWidgetControlNames ["button"]] = _G [DF.GlobalWidgetControlNames ["button"]] or metaPrototype
|
||||
end
|
||||
|
||||
local ButtonMetaFunctions = _G [DF.GlobalWidgetControlNames ["button"]]
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> metatables
|
||||
@@ -75,26 +86,25 @@ local ButtonMetaFunctions = {}
|
||||
return _rawget (_object, "is_locked")
|
||||
end
|
||||
|
||||
local get_members_function_index = {
|
||||
["tooltip"] = gmember_tooltip,
|
||||
["shown"] = gmember_shown,
|
||||
["width"] = gmember_width,
|
||||
["height"] = gmember_height,
|
||||
["text"] = gmember_text,
|
||||
["clickfunction"] = gmember_function,
|
||||
["texture"] = gmember_texture,
|
||||
["locked"] = gmember_locked,
|
||||
["fontcolor"] = gmember_textcolor,
|
||||
["fontface"] = gmember_textfont,
|
||||
["fontsize"] = gmember_textsize,
|
||||
["textcolor"] = gmember_textcolor, --alias
|
||||
["textfont"] = gmember_textfont, --alias
|
||||
["textsize"] = gmember_textsize --alias
|
||||
}
|
||||
ButtonMetaFunctions.GetMembers = ButtonMetaFunctions.GetMembers or {}
|
||||
ButtonMetaFunctions.GetMembers ["tooltip"] = gmember_tooltip
|
||||
ButtonMetaFunctions.GetMembers ["shown"] = gmember_shown
|
||||
ButtonMetaFunctions.GetMembers ["width"] = gmember_width
|
||||
ButtonMetaFunctions.GetMembers ["height"] = gmember_height
|
||||
ButtonMetaFunctions.GetMembers ["text"] = gmember_text
|
||||
ButtonMetaFunctions.GetMembers ["clickfunction"] = gmember_function
|
||||
ButtonMetaFunctions.GetMembers ["texture"] = gmember_texture
|
||||
ButtonMetaFunctions.GetMembers ["locked"] = gmember_locked
|
||||
ButtonMetaFunctions.GetMembers ["fontcolor"] = gmember_textcolor
|
||||
ButtonMetaFunctions.GetMembers ["fontface"] = gmember_textfont
|
||||
ButtonMetaFunctions.GetMembers ["fontsize"] = gmember_textsize
|
||||
ButtonMetaFunctions.GetMembers ["textcolor"] = gmember_textcolor --alias
|
||||
ButtonMetaFunctions.GetMembers ["textfont"] = gmember_textfont --alias
|
||||
ButtonMetaFunctions.GetMembers ["textsize"] = gmember_textsize --alias
|
||||
|
||||
ButtonMetaFunctions.__index = function (_table, _member_requested)
|
||||
|
||||
local func = get_members_function_index [_member_requested]
|
||||
local func = ButtonMetaFunctions.GetMembers [_member_requested]
|
||||
if (func) then
|
||||
return func (_table, _member_requested)
|
||||
end
|
||||
@@ -206,25 +216,24 @@ local ButtonMetaFunctions = {}
|
||||
_object.capsule_textalign = "right"
|
||||
end
|
||||
end
|
||||
|
||||
local set_members_function_index = {
|
||||
["tooltip"] = smember_tooltip,
|
||||
["show"] = smember_show,
|
||||
["hide"] = smember_hide,
|
||||
["width"] = smember_width,
|
||||
["height"] = smember_height,
|
||||
["text"] = smember_text,
|
||||
["clickfunction"] = smember_function,
|
||||
["textcolor"] = smember_textcolor,
|
||||
["textfont"] = smember_textfont,
|
||||
["textsize"] = smember_textsize,
|
||||
["texture"] = smember_texture,
|
||||
["locked"] = smember_locked,
|
||||
["textalign"] = smember_textalign,
|
||||
}
|
||||
|
||||
ButtonMetaFunctions.SetMembers = ButtonMetaFunctions.SetMembers or {}
|
||||
ButtonMetaFunctions.SetMembers ["tooltip"] = smember_tooltip
|
||||
ButtonMetaFunctions.SetMembers ["show"] = smember_show
|
||||
ButtonMetaFunctions.SetMembers ["hide"] = smember_hide
|
||||
ButtonMetaFunctions.SetMembers ["width"] = smember_width
|
||||
ButtonMetaFunctions.SetMembers ["height"] = smember_height
|
||||
ButtonMetaFunctions.SetMembers ["text"] = smember_text
|
||||
ButtonMetaFunctions.SetMembers ["clickfunction"] = smember_function
|
||||
ButtonMetaFunctions.SetMembers ["textcolor"] = smember_textcolor
|
||||
ButtonMetaFunctions.SetMembers ["textfont"] = smember_textfont
|
||||
ButtonMetaFunctions.SetMembers ["textsize"] = smember_textsize
|
||||
ButtonMetaFunctions.SetMembers ["texture"] = smember_texture
|
||||
ButtonMetaFunctions.SetMembers ["locked"] = smember_locked
|
||||
ButtonMetaFunctions.SetMembers ["textalign"] = smember_textalign
|
||||
|
||||
ButtonMetaFunctions.__newindex = function (_table, _key, _value)
|
||||
local func = set_members_function_index [_key]
|
||||
local func = ButtonMetaFunctions.SetMembers [_key]
|
||||
if (func) then
|
||||
return func (_table, _value)
|
||||
else
|
||||
@@ -473,15 +482,6 @@ local ButtonMetaFunctions = {}
|
||||
return self.funcright()
|
||||
end
|
||||
|
||||
--> hooks
|
||||
function ButtonMetaFunctions:SetHook (hookType, func)
|
||||
if (func) then
|
||||
_rawset (self, hookType.."Hook", func)
|
||||
else
|
||||
_rawset (self, hookType.."Hook", nil)
|
||||
end
|
||||
end
|
||||
|
||||
--> custom textures
|
||||
function ButtonMetaFunctions:InstallCustomTexture (texture, rect, coords, use_split, side_textures, side_textures2)
|
||||
|
||||
@@ -587,6 +587,8 @@ local ButtonMetaFunctions = {}
|
||||
|
||||
local OnEnter = function (button)
|
||||
|
||||
local capsule = button.MyObject
|
||||
|
||||
if (button.textureTopLeft) then
|
||||
button.textureLeft:SetTexCoord (0, 4/128, 40/128, 56/128)
|
||||
button.textureRight:SetTexCoord (124/128, 1, 40/128, 56/128)
|
||||
@@ -598,12 +600,10 @@ local ButtonMetaFunctions = {}
|
||||
button.textureBottomLeft:SetTexCoord (0, 8/128, 56/128, 64/128)
|
||||
button.textureBottomRight:SetTexCoord (120/128, 1, 56/128, 64/128)
|
||||
end
|
||||
|
||||
if (button.MyObject.OnEnterHook) then
|
||||
local interrupt = button.MyObject.OnEnterHook (button, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnEnter", button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
button.MyObject.is_mouse_over = true
|
||||
@@ -637,6 +637,8 @@ local ButtonMetaFunctions = {}
|
||||
|
||||
local OnLeave = function (button)
|
||||
|
||||
local capsule = button.MyObject
|
||||
|
||||
if (button.textureLeft and not button.MyObject.is_mouse_down) then
|
||||
button.textureLeft:SetTexCoord (0, 4/128, 9/128, 24/128)
|
||||
button.textureRight:SetTexCoord (124/128, 1, 9/128, 24/128)
|
||||
@@ -648,12 +650,10 @@ local ButtonMetaFunctions = {}
|
||||
button.textureBottomLeft:SetTexCoord (0, 8/128, 24/128, 32/128)
|
||||
button.textureBottomRight:SetTexCoord (120/128, 1, 24/128, 32/128)
|
||||
end
|
||||
|
||||
if (button.MyObject.OnLeaveHook) then
|
||||
local interrupt = button.MyObject.OnLeaveHook (button, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnLeave", button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
button.MyObject.is_mouse_over = false
|
||||
@@ -682,27 +682,27 @@ local ButtonMetaFunctions = {}
|
||||
end
|
||||
|
||||
local OnHide = function (button)
|
||||
if (button.MyObject.OnHideHook) then
|
||||
local interrupt = button.MyObject.OnHideHook (button, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = button.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnHide", button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnShow = function (button)
|
||||
if (button.MyObject.OnShowHook) then
|
||||
local interrupt = button.MyObject.OnShowHook (button, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = button.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnShow", button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnMouseDown = function (button, buttontype)
|
||||
local capsule = button.MyObject
|
||||
|
||||
if (not button:IsEnabled()) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
if (button.textureTopLeft) then
|
||||
button.textureLeft:SetTexCoord (0, 4/128, 72/128, 88/128)
|
||||
@@ -715,12 +715,10 @@ local ButtonMetaFunctions = {}
|
||||
button.textureBottomLeft:SetTexCoord (0, 8/128, 88/128, 96/128)
|
||||
button.textureBottomRight:SetTexCoord (120/128, 1, 88/128, 96/128)
|
||||
end
|
||||
|
||||
if (button.MyObject.OnMouseDownHook) then
|
||||
local interrupt = button.MyObject.OnMouseDownHook (button, buttontype, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseDown", button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
button.MyObject.is_mouse_down = true
|
||||
@@ -803,11 +801,10 @@ local ButtonMetaFunctions = {}
|
||||
end
|
||||
end
|
||||
|
||||
if (button.MyObject.OnMouseUpHook) then
|
||||
local interrupt = button.MyObject.OnMouseUpHook (button, buttontype, button.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = button.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseUp", button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
button.MyObject.is_mouse_down = false
|
||||
@@ -957,20 +954,10 @@ function DF:NewButton (parent, container, name, member, w, h, func, param1, para
|
||||
end
|
||||
|
||||
--> default members:
|
||||
--> hooks
|
||||
ButtonObject.OnEnterHook = nil
|
||||
ButtonObject.OnLeaveHook = nil
|
||||
ButtonObject.OnHideHook = nil
|
||||
ButtonObject.OnShowHook = nil
|
||||
ButtonObject.OnMouseDownHook = nil
|
||||
ButtonObject.OnMouseUpHook = nil
|
||||
--> misc
|
||||
ButtonObject.is_locked = true
|
||||
ButtonObject.container = container
|
||||
ButtonObject.have_tooltip = nil
|
||||
ButtonObject.options = {OnGrab = false}
|
||||
|
||||
|
||||
ButtonObject.button = CreateFrame ("button", name, parent, "DetailsFrameworkButtonTemplate")
|
||||
ButtonObject.widget = ButtonObject.button
|
||||
|
||||
@@ -1006,12 +993,15 @@ function DF:NewButton (parent, container, name, member, w, h, func, param1, para
|
||||
|
||||
ButtonObject.button.text:SetText (text)
|
||||
ButtonObject.button.text:SetPoint ("center", ButtonObject.button, "center")
|
||||
|
||||
|
||||
local text_width = ButtonObject.button.text:GetStringWidth()
|
||||
if (text_width > w-15 and ButtonObject.button.text:GetText() ~= "") then
|
||||
if (not short_method) then
|
||||
if (short_method == false) then --> if is false, do not use auto resize
|
||||
--do nothing
|
||||
elseif (not short_method) then --> if the value is omitted, use the default resize
|
||||
local new_width = text_width+15
|
||||
ButtonObject.button:SetWidth (new_width)
|
||||
|
||||
elseif (short_method == 1) then
|
||||
local loop = true
|
||||
local textsize = 11
|
||||
@@ -1051,6 +1041,15 @@ function DF:NewButton (parent, container, name, member, w, h, func, param1, para
|
||||
end
|
||||
|
||||
--> hooks
|
||||
ButtonObject.HookList = {
|
||||
OnEnter = {},
|
||||
OnLeave = {},
|
||||
OnHide = {},
|
||||
OnShow = {},
|
||||
OnMouseDown = {},
|
||||
OnMouseUp = {},
|
||||
}
|
||||
|
||||
ButtonObject.button:SetScript ("OnEnter", OnEnter)
|
||||
ButtonObject.button:SetScript ("OnLeave", OnLeave)
|
||||
ButtonObject.button:SetScript ("OnHide", OnHide)
|
||||
@@ -1119,7 +1118,7 @@ function DF:NewColorPickButton (parent, name, member, callback, alpha, button_te
|
||||
|
||||
--textura da cor
|
||||
local img = DF:NewImage (button, nil, color_button_width, color_button_height, nil, nil, "color_texture", "$parentTex")
|
||||
img:SetTexture (1, 1, 1)
|
||||
img:SetColorTexture (1, 1, 1)
|
||||
img:SetPoint ("topleft", button.widget, "topleft", 1, -2)
|
||||
img:SetPoint ("bottomright", button.widget, "bottomright", -1, 1)
|
||||
img:SetDrawLayer ("background", 2)
|
||||
|
||||
+14
-5
@@ -2493,7 +2493,7 @@ function DF:CreateCoolTip()
|
||||
end
|
||||
|
||||
--> check data integrity
|
||||
if (type (iconTexture) ~= "string" and (type (iconTexture) ~= "table" or not iconTexture.GetObjectType or iconTexture:GetObjectType() ~= "Texture") ) then
|
||||
if ( (type (iconTexture) ~= "string" and type (iconTexture) ~= "number") and (type (iconTexture) ~= "table" or not iconTexture.GetObjectType or iconTexture:GetObjectType() ~= "Texture") ) then
|
||||
return --> return error
|
||||
end
|
||||
|
||||
@@ -3033,10 +3033,17 @@ function DF:CreateCoolTip()
|
||||
--> 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 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 preset2_backdrop = {bgFile = DF.folder .. "background", edgeFile = [[Interface\Buttons\WHITE8X8]], tile = true,
|
||||
edgeSize = 1, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}
|
||||
local default_backdrop_color = {0.09019, 0.09019, 0.18823, 0.8}
|
||||
local default_backdropborder_color = {1, 1, 1, 1}
|
||||
|
||||
local gray_table = {0.37, 0.37, 0.37, 0.95}
|
||||
local white_table = {1, 1, 1, 1}
|
||||
local black_table = {0.2, 0.2, 0.2, 1}
|
||||
|
||||
function CoolTip:Preset (number)
|
||||
self:Reset()
|
||||
@@ -3058,9 +3065,11 @@ function DF:CreateCoolTip()
|
||||
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)
|
||||
--self:SetColor (1, 0.5, 0.5, 0.5, 0.5)
|
||||
self:SetColor (1, 0.5, 0.5, 0.5, 0)
|
||||
|
||||
self:SetBackdrop (1, preset2_backdrop, gray_table, black_table)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+63
-63
@@ -16,7 +16,18 @@ local _string_len = string.len --> lua local
|
||||
|
||||
local cleanfunction = function() end
|
||||
local APIDropDownFunctions = false
|
||||
local DropDownMetaFunctions = {}
|
||||
|
||||
do
|
||||
local metaPrototype = {
|
||||
WidgetType = "dropdown",
|
||||
SetHook = DF.SetHook,
|
||||
RunHooksForWidget = DF.RunHooksForWidget,
|
||||
}
|
||||
|
||||
_G [DF.GlobalWidgetControlNames ["dropdown"]] = _G [DF.GlobalWidgetControlNames ["dropdown"]] or metaPrototype
|
||||
end
|
||||
|
||||
local DropDownMetaFunctions = _G [DF.GlobalWidgetControlNames ["dropdown"]]
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> metatables
|
||||
@@ -65,21 +76,20 @@ local DropDownMetaFunctions = {}
|
||||
return _rawget (self, "realsizeH")
|
||||
end
|
||||
|
||||
local get_members_function_index = {
|
||||
["value"] = gmember_value,
|
||||
["text"] = gmember_text,
|
||||
["shown"] = gmember_shown,
|
||||
["width"] = gmember_width,
|
||||
["menuwidth"] = gmember_menuwidth,
|
||||
["height"] = gmember_height,
|
||||
["menuheight"] = gmember_menuheight,
|
||||
["tooltip"] = gmember_tooltip,
|
||||
["func"] = gmember_function,
|
||||
}
|
||||
DropDownMetaFunctions.GetMembers = DropDownMetaFunctions.GetMembers or {}
|
||||
DropDownMetaFunctions.GetMembers ["value"] = gmember_value
|
||||
DropDownMetaFunctions.GetMembers ["text"] = gmember_text
|
||||
DropDownMetaFunctions.GetMembers ["shown"] = gmember_shown
|
||||
DropDownMetaFunctions.GetMembers ["width"] = gmember_width
|
||||
DropDownMetaFunctions.GetMembers ["menuwidth"] = gmember_menuwidth
|
||||
DropDownMetaFunctions.GetMembers ["height"] = gmember_height
|
||||
DropDownMetaFunctions.GetMembers ["menuheight"] = gmember_menuheight
|
||||
DropDownMetaFunctions.GetMembers ["tooltip"] = gmember_tooltip
|
||||
DropDownMetaFunctions.GetMembers ["func"] = gmember_function
|
||||
|
||||
DropDownMetaFunctions.__index = function (_table, _member_requested)
|
||||
|
||||
local func = get_members_function_index [_member_requested]
|
||||
local func = DropDownMetaFunctions.GetMembers [_member_requested]
|
||||
if (func) then
|
||||
return func (_table, _member_requested)
|
||||
end
|
||||
@@ -135,19 +145,18 @@ local DropDownMetaFunctions = {}
|
||||
_object:SetMenuSize (nil, _value)
|
||||
end
|
||||
|
||||
local set_members_function_index = {
|
||||
["tooltip"] = smember_tooltip,
|
||||
["show"] = smember_show,
|
||||
["hide"] = smember_hide,
|
||||
["width"] = smember_width,
|
||||
["menuwidth"] = smember_menuwidth,
|
||||
["height"] = smember_height,
|
||||
["menuheight"] = smember_menuheight,
|
||||
["func"] = smember_function,
|
||||
}
|
||||
DropDownMetaFunctions.SetMembers = DropDownMetaFunctions.SetMembers or {}
|
||||
DropDownMetaFunctions.SetMembers ["tooltip"] = smember_tooltip
|
||||
DropDownMetaFunctions.SetMembers ["show"] = smember_show
|
||||
DropDownMetaFunctions.SetMembers ["hide"] = smember_hide
|
||||
DropDownMetaFunctions.SetMembers ["width"] = smember_width
|
||||
DropDownMetaFunctions.SetMembers ["menuwidth"] = smember_menuwidth
|
||||
DropDownMetaFunctions.SetMembers ["height"] = smember_height
|
||||
DropDownMetaFunctions.SetMembers ["menuheight"] = smember_menuheight
|
||||
DropDownMetaFunctions.SetMembers ["func"] = smember_function
|
||||
|
||||
DropDownMetaFunctions.__newindex = function (_table, _key, _value)
|
||||
local func = set_members_function_index [_key]
|
||||
local func = DropDownMetaFunctions.SetMembers [_key]
|
||||
if (func) then
|
||||
return func (_table, _value)
|
||||
else
|
||||
@@ -285,15 +294,6 @@ local DropDownMetaFunctions = {}
|
||||
_rawset (self, "FixedValue", value)
|
||||
end
|
||||
|
||||
--> hooks
|
||||
function DropDownMetaFunctions:SetHook (hookType, func)
|
||||
if (func) then
|
||||
_rawset (self, hookType.."Hook", func)
|
||||
else
|
||||
_rawset (self, hookType.."Hook", nil)
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> scripts
|
||||
|
||||
@@ -752,11 +752,10 @@ end
|
||||
|
||||
function DetailsFrameworkDropDownOnEnter (self)
|
||||
|
||||
if (self.MyObject.OnEnterHook) then
|
||||
local interrupt = self.MyObject.OnEnterHook (self)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = self.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnEnter", self, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (self.MyObject.onenter_backdrop) then
|
||||
@@ -787,11 +786,10 @@ function DetailsFrameworkDropDownOnEnter (self)
|
||||
end
|
||||
|
||||
function DetailsFrameworkDropDownOnLeave (self)
|
||||
if (self.MyObject.OnLeaveHook) then
|
||||
local interrupt = self.MyObject.OnLeaveHook (self)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = self.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnLeave", self, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (self.MyObject.onleave_backdrop) then
|
||||
@@ -816,20 +814,18 @@ function DetailsFrameworkDropDownOnSizeChanged (self, w, h)
|
||||
end
|
||||
|
||||
function DetailsFrameworkDropDownOnShow (self)
|
||||
if (self.MyObject and self.MyObject.OnShowHook) then
|
||||
local interrupt = self.MyObject.OnShowHook (self)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = self.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnShow", self, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
function DetailsFrameworkDropDownOnHide (self)
|
||||
if (self.MyObject and self.MyObject.OnHideHook) then
|
||||
local interrupt = self.MyObject.OnHideHook (self)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = self.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnHide", self, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
self.MyObject:Close()
|
||||
@@ -934,15 +930,8 @@ function DF:NewDropDown (parent, container, name, member, w, h, func, default, t
|
||||
end
|
||||
|
||||
--> default members:
|
||||
--> hooks
|
||||
DropDownObject.OnEnterHook = nil
|
||||
DropDownObject.OnLeaveHook = nil
|
||||
DropDownObject.OnHideHook = nil
|
||||
DropDownObject.OnShowHook = nil
|
||||
DropDownObject.OnMouseDownHook = nil
|
||||
--> misc
|
||||
DropDownObject.container = container
|
||||
DropDownObject.have_tooltip = nil
|
||||
|
||||
DropDownObject.dropdown = CreateFrame ("Button", name, parent, "DetailsFrameworkDropDownTemplate")
|
||||
DropDownObject.widget = DropDownObject.dropdown
|
||||
@@ -1002,11 +991,22 @@ function DF:NewDropDown (parent, container, name, member, w, h, func, default, t
|
||||
DropDownObject:HideScroll()
|
||||
DropDownObject.label:SetSize (DropDownObject.dropdown:GetWidth()-40, 10)
|
||||
|
||||
DropDownObject.HookList = {
|
||||
OnEnter = {},
|
||||
OnLeave = {},
|
||||
OnHide = {},
|
||||
OnShow = {},
|
||||
}
|
||||
|
||||
DropDownObject.dropdown:SetScript ("OnShow", DetailsFrameworkDropDownOnShow)
|
||||
DropDownObject.dropdown:SetScript ("OnHide", DetailsFrameworkDropDownOnHide)
|
||||
DropDownObject.dropdown:SetScript ("OnEnter", DetailsFrameworkDropDownOnEnter)
|
||||
DropDownObject.dropdown:SetScript ("OnLeave", DetailsFrameworkDropDownOnLeave)
|
||||
|
||||
--> setup class
|
||||
_setmetatable (DropDownObject, DropDownMetaFunctions)
|
||||
|
||||
|
||||
--> initialize first menu selected
|
||||
|
||||
if (type (default) == "string") then
|
||||
DropDownObject:Select (default)
|
||||
|
||||
@@ -1020,6 +1020,6 @@ function DF:NewDropDown (parent, container, name, member, w, h, func, default, t
|
||||
DropDownObject:SetTemplate (template)
|
||||
end
|
||||
|
||||
return DropDownObject
|
||||
return DropDownObject
|
||||
|
||||
end
|
||||
@@ -79,7 +79,7 @@
|
||||
<Anchor point="TOPLEFT" relativeTo="$Parent" relativePoint="BOTTOMLEFT"/>
|
||||
</Anchors>
|
||||
|
||||
<Backdrop bgFile="Interface\AddOns\Details\images\background" edgeFile="Interface\Buttons\WHITE8X8" tile="true">
|
||||
<Backdrop bgFile="Interface\FrameGeneral\UI-Background-Marble" edgeFile="Interface\Buttons\WHITE8X8" tile="true">
|
||||
<EdgeSize>
|
||||
<AbsValue val="1"/>
|
||||
</EdgeSize>
|
||||
@@ -96,8 +96,8 @@
|
||||
DetailsFrameworkDropDownOptionsFrameOnHide (self);
|
||||
</OnHide>
|
||||
<OnLoad>
|
||||
self:SetBackdropColor (0, 0, 0, 0.95);
|
||||
self:SetBackdropBorderColor (.2, .20, .20, 0.95);
|
||||
self:SetBackdropColor (0, 0, 0, 0.92);
|
||||
self:SetBackdropBorderColor (0, 0, 0, 1);
|
||||
</OnLoad>
|
||||
</Scripts>
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
</Anchors>
|
||||
|
||||
<ScrollChild>
|
||||
<Frame name="$Parent_ScrollChild" frameStrata="DIALOG" parentKey="scrollchild">
|
||||
<Frame name="$Parent_ScrollChild" frameStrata="FULLSCREEN" parentKey="scrollchild">
|
||||
|
||||
<Size x="150" y="150"/>
|
||||
|
||||
@@ -161,19 +161,19 @@
|
||||
</OnLoad>
|
||||
|
||||
<OnShow>
|
||||
DetailsFrameworkDropDownOnShow (self);
|
||||
<!--DetailsFrameworkDropDownOnShow (self);-->
|
||||
</OnShow>
|
||||
|
||||
<OnHide>
|
||||
DetailsFrameworkDropDownOnHide (self);
|
||||
<!--DetailsFrameworkDropDownOnHide (self);-->
|
||||
</OnHide>
|
||||
|
||||
<OnEnter>
|
||||
DetailsFrameworkDropDownOnEnter (self);
|
||||
<!--DetailsFrameworkDropDownOnEnter (self);-->
|
||||
</OnEnter>
|
||||
|
||||
<OnLeave>
|
||||
DetailsFrameworkDropDownOnLeave (self);
|
||||
<!--DetailsFrameworkDropDownOnLeave (self);-->
|
||||
</OnLeave>
|
||||
|
||||
<OnSizeChanged>
|
||||
|
||||
+209
-5
@@ -1,5 +1,5 @@
|
||||
|
||||
local dversion = 19
|
||||
local dversion = 22
|
||||
local major, minor = "DetailsFramework-1.0", dversion
|
||||
local DF, oldminor = LibStub:NewLibrary (major, minor)
|
||||
|
||||
@@ -30,6 +30,9 @@ DF.SliderCounter = DF.SliderCounter or init_counter
|
||||
DF.SwitchCounter = DF.SwitchCounter or init_counter
|
||||
DF.SplitBarCounter = DF.SplitBarCounter or init_counter
|
||||
|
||||
DF.FRAMELEVEL_OVERLAY = 750
|
||||
DF.FRAMELEVEL_BACKGROUND = 150
|
||||
|
||||
DF.FrameWorkVersion = tostring (dversion)
|
||||
function DF:PrintVersion()
|
||||
print ("Details! Framework Version:", DF.FrameWorkVersion)
|
||||
@@ -104,6 +107,9 @@ local embed_functions = {
|
||||
"InstallTemplate",
|
||||
"GetFrameworkFolder",
|
||||
"ShowPanicWarning",
|
||||
"SetFrameworkDebugState",
|
||||
"FindHighestParent",
|
||||
"OpenInterfaceProfile",
|
||||
}
|
||||
|
||||
DF.table = {}
|
||||
@@ -112,6 +118,10 @@ function DF:GetFrameworkFolder()
|
||||
return DF.folder
|
||||
end
|
||||
|
||||
function DF:SetFrameworkDebugState (state)
|
||||
DF.debug = state
|
||||
end
|
||||
|
||||
function DF:FadeFrame (frame, t)
|
||||
if (t == 0) then
|
||||
frame.hidden = false
|
||||
@@ -332,11 +342,13 @@ function DF:CreateFlashAnimation (frame, onFinishFunc, onLoopFunc)
|
||||
|
||||
FlashAnimation.fadeOut = FlashAnimation:CreateAnimation ("Alpha") --> fade out anime
|
||||
FlashAnimation.fadeOut:SetOrder (1)
|
||||
FlashAnimation.fadeOut:SetChange (1)
|
||||
FlashAnimation.fadeOut:SetFromAlpha (0)
|
||||
FlashAnimation.fadeOut:SetToAlpha (1)
|
||||
|
||||
FlashAnimation.fadeIn = FlashAnimation:CreateAnimation ("Alpha") --> fade in anime
|
||||
FlashAnimation.fadeIn:SetOrder (2)
|
||||
FlashAnimation.fadeIn:SetChange (-1)
|
||||
FlashAnimation.fadeIn:SetFromAlpha (1)
|
||||
FlashAnimation.fadeIn:SetToAlpha (0)
|
||||
|
||||
frame.FlashAnimation = FlashAnimation
|
||||
FlashAnimation.frame = frame
|
||||
@@ -473,6 +485,8 @@ end
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> menus
|
||||
|
||||
local disable_on_combat = {}
|
||||
|
||||
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
|
||||
@@ -488,6 +502,8 @@ end
|
||||
|
||||
for index, widget_table in ipairs (menu) do
|
||||
|
||||
local widget_created
|
||||
|
||||
if (widget_table.type == "blank" or widget_table.type == "space") then
|
||||
-- do nothing
|
||||
|
||||
@@ -513,6 +529,7 @@ end
|
||||
end
|
||||
|
||||
tinsert (parent.widget_list, dropdown)
|
||||
widget_created = 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)
|
||||
@@ -535,6 +552,7 @@ end
|
||||
end
|
||||
|
||||
tinsert (parent.widget_list, switch)
|
||||
widget_created = switch
|
||||
|
||||
elseif (widget_table.type == "range" or widget_table.type == "slider") then
|
||||
local is_decimanls = widget_table.usedecimals
|
||||
@@ -554,6 +572,7 @@ end
|
||||
end
|
||||
|
||||
tinsert (parent.widget_list, slider)
|
||||
widget_created = 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)
|
||||
@@ -578,6 +597,7 @@ end
|
||||
end
|
||||
|
||||
tinsert (parent.widget_list, colorpick)
|
||||
widget_created = colorpick
|
||||
|
||||
elseif (widget_table.type == "execute" or widget_table.type == "button") then
|
||||
|
||||
@@ -596,8 +616,13 @@ end
|
||||
end
|
||||
|
||||
tinsert (parent.widget_list, button)
|
||||
widget_created = button
|
||||
|
||||
end
|
||||
|
||||
if (widget_table.nocombat) then
|
||||
tinsert (disable_on_combat, widget_created)
|
||||
end
|
||||
|
||||
if (widget_table.spacement) then
|
||||
cur_y = cur_y - 30
|
||||
@@ -605,16 +630,59 @@ end
|
||||
cur_y = cur_y - 20
|
||||
end
|
||||
|
||||
if (cur_y < height) then
|
||||
if (widget_table.type == "breakline" or cur_y < height) then
|
||||
cur_y = y_offset
|
||||
cur_x = cur_x + max_x + 30
|
||||
|
||||
max_x = 0
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
DF.RefreshUnsafeOptionsWidgets()
|
||||
|
||||
end
|
||||
|
||||
local lock_notsafe_widgets = function()
|
||||
for _, widget in ipairs (disable_on_combat) do
|
||||
widget:Disable()
|
||||
end
|
||||
end
|
||||
local unlock_notsafe_widgets = function()
|
||||
for _, widget in ipairs (disable_on_combat) do
|
||||
widget:Enable()
|
||||
end
|
||||
end
|
||||
function DF.RefreshUnsafeOptionsWidgets()
|
||||
if (DF.PlayerHasCombatFlag) then
|
||||
lock_notsafe_widgets()
|
||||
else
|
||||
unlock_notsafe_widgets()
|
||||
end
|
||||
end
|
||||
DF.PlayerHasCombatFlag = false
|
||||
local ProtectCombatFrame = CreateFrame ("frame")
|
||||
ProtectCombatFrame:RegisterEvent ("PLAYER_REGEN_ENABLED")
|
||||
ProtectCombatFrame:RegisterEvent ("PLAYER_REGEN_DISABLED")
|
||||
ProtectCombatFrame:RegisterEvent ("PLAYER_ENTERING_WORLD")
|
||||
ProtectCombatFrame:SetScript ("OnEvent", function (self, event)
|
||||
if (event == "PLAYER_ENTERING_WORLD") then
|
||||
if (InCombatLockdown()) then
|
||||
DF.PlayerHasCombatFlag = true
|
||||
else
|
||||
DF.PlayerHasCombatFlag = false
|
||||
end
|
||||
DF.RefreshUnsafeOptionsWidgets()
|
||||
|
||||
elseif (event == "PLAYER_REGEN_ENABLED") then
|
||||
DF.PlayerHasCombatFlag = false
|
||||
DF.RefreshUnsafeOptionsWidgets()
|
||||
|
||||
elseif (event == "PLAYER_REGEN_DISABLED") then
|
||||
DF.PlayerHasCombatFlag = true
|
||||
DF.RefreshUnsafeOptionsWidgets()
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> tutorials
|
||||
@@ -922,3 +990,139 @@ function DF.GetParentName (frame)
|
||||
end
|
||||
return parentName
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> widget scripts and hooks
|
||||
|
||||
function DF:RunHooksForWidget (event, ...)
|
||||
local hooks = self.HookList [event]
|
||||
|
||||
if (not hooks) then
|
||||
print (self.widget:GetName(), "sem hook para", event)
|
||||
return
|
||||
end
|
||||
|
||||
for i, func in ipairs (hooks) do
|
||||
local success, canInterrupt = pcall (func, ...)
|
||||
if (not success) then
|
||||
error ("Details! Framework: " .. event .. " hook for " .. self:GetName() .. ": " .. canInterrupt)
|
||||
elseif (canInterrupt) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function DF:SetHook (hookType, func)
|
||||
if (self.HookList [hookType]) then
|
||||
if (type (func) == "function") then
|
||||
local isRemoval = false
|
||||
for i = #self.HookList [hookType], 1, -1 do
|
||||
if (self.HookList [hookType] [i] == func) then
|
||||
tremove (self.HookList [hookType], i)
|
||||
isRemoval = true
|
||||
break
|
||||
end
|
||||
end
|
||||
if (not isRemoval) then
|
||||
tinsert (self.HookList [hookType], func)
|
||||
end
|
||||
else
|
||||
if (DF.debug) then
|
||||
error ("Details! Framework: invalid function for widget " .. self.WidgetType .. ".")
|
||||
end
|
||||
end
|
||||
else
|
||||
if (DF.debug) then
|
||||
error ("Details! Framework: unknown hook type for widget " .. self.WidgetType .. ": '" .. hookType .. "'.")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> members
|
||||
|
||||
DF.GlobalWidgetControlNames = {
|
||||
textentry = "DF_TextEntryMetaFunctions",
|
||||
button = "DF_ButtonMetaFunctions",
|
||||
panel = "DF_PanelMetaFunctions",
|
||||
dropdown = "DF_DropdownMetaFunctions",
|
||||
label = "DF_LabelMetaFunctions",
|
||||
normal_bar = "DF_NormalBarMetaFunctions",
|
||||
image = "DF_ImageMetaFunctions",
|
||||
slider = "DF_SliderMetaFunctions",
|
||||
split_bar = "DF_SplitBarMetaFunctions",
|
||||
}
|
||||
|
||||
function DF:AddMemberForWidget (widgetName, memberType, memberName, func)
|
||||
if (DF.GlobalWidgetControlNames [widgetName]) then
|
||||
if (type (memberName) == "string" and (memberType == "SET" or memberType == "GET")) then
|
||||
if (func) then
|
||||
local widgetControlObject = _G [DF.GlobalWidgetControlNames [widgetName]]
|
||||
|
||||
if (memberType == "SET") then
|
||||
widgetControlObject ["SetMembers"] [memberName] = func
|
||||
elseif (memberType == "GET") then
|
||||
widgetControlObject ["GetMembers"] [memberName] = func
|
||||
end
|
||||
else
|
||||
if (DF.debug) then
|
||||
error ("Details! Framework: AddMemberForWidget invalid function.")
|
||||
end
|
||||
end
|
||||
else
|
||||
if (DF.debug) then
|
||||
error ("Details! Framework: AddMemberForWidget unknown memberName or memberType.")
|
||||
end
|
||||
end
|
||||
else
|
||||
if (DF.debug) then
|
||||
error ("Details! Framework: AddMemberForWidget unknown widget type: " .. (widgetName or "") .. ".")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
|
||||
function DF:OpenInterfaceProfile()
|
||||
InterfaceOptionsFrame_OpenToCategory (self.__name)
|
||||
InterfaceOptionsFrame_OpenToCategory (self.__name)
|
||||
for i = 1, 100 do
|
||||
local button = _G ["InterfaceOptionsFrameAddOnsButton" .. i]
|
||||
if (button) then
|
||||
local text = _G ["InterfaceOptionsFrameAddOnsButton" .. i .. "Text"]
|
||||
if (text) then
|
||||
text = text:GetText()
|
||||
if (text == self.__name) then
|
||||
local toggle = _G ["InterfaceOptionsFrameAddOnsButton" .. i .. "Toggle"]
|
||||
if (toggle) then
|
||||
if (toggle:GetNormalTexture():GetTexture():find ("PlusButton")) then
|
||||
--is minimized, need expand
|
||||
toggle:Click()
|
||||
_G ["InterfaceOptionsFrameAddOnsButton" .. i+1]:Click()
|
||||
elseif (toggle:GetNormalTexture():GetTexture():find ("MinusButton")) then
|
||||
--isn't minimized
|
||||
_G ["InterfaceOptionsFrameAddOnsButton" .. i+1]:Click()
|
||||
end
|
||||
end
|
||||
break
|
||||
end
|
||||
end
|
||||
else
|
||||
self:Msg ("Couldn't not find the profile panel.")
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-----------------------------
|
||||
--safe copy from blizz api
|
||||
function DF:Mixin (object, ...)
|
||||
for i = 1, select("#", ...) do
|
||||
local mixin = select(i, ...);
|
||||
for k, v in pairs(mixin) do
|
||||
object[k] = v;
|
||||
end
|
||||
end
|
||||
|
||||
return object;
|
||||
end
|
||||
|
||||
+44
-35
@@ -15,7 +15,18 @@ local loadstring = loadstring --> lua local
|
||||
|
||||
local cleanfunction = function() end
|
||||
local APILabelFunctions = false
|
||||
local LabelMetaFunctions = {}
|
||||
|
||||
do
|
||||
local metaPrototype = {
|
||||
WidgetType = "label",
|
||||
SetHook = DF.SetHook,
|
||||
RunHooksForWidget = DF.RunHooksForWidget,
|
||||
}
|
||||
|
||||
_G [DF.GlobalWidgetControlNames ["label"]] = _G [DF.GlobalWidgetControlNames ["label"]] or metaPrototype
|
||||
end
|
||||
|
||||
local LabelMetaFunctions = _G [DF.GlobalWidgetControlNames ["label"]]
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> metatables
|
||||
@@ -58,23 +69,21 @@ local LabelMetaFunctions = {}
|
||||
return fontsize
|
||||
end
|
||||
|
||||
|
||||
local get_members_function_index = {
|
||||
["shown"] = gmember_shown,
|
||||
["width"] = gmember_width,
|
||||
["height"] = gmember_height,
|
||||
["text"] = gmember_text,
|
||||
["fontcolor"] = gmember_textcolor,
|
||||
["fontface"] = gmember_textfont,
|
||||
["fontsize"] = gmember_textsize,
|
||||
["textcolor"] = gmember_textcolor, --alias
|
||||
["textfont"] = gmember_textfont, --alias
|
||||
["textsize"] = gmember_textsize --alias
|
||||
}
|
||||
LabelMetaFunctions.GetMembers = LabelMetaFunctions.GetMembers or {}
|
||||
LabelMetaFunctions.GetMembers ["shown"] = gmember_shown
|
||||
LabelMetaFunctions.GetMembers ["width"] = gmember_width
|
||||
LabelMetaFunctions.GetMembers ["height"] = gmember_height
|
||||
LabelMetaFunctions.GetMembers ["text"] = gmember_text
|
||||
LabelMetaFunctions.GetMembers ["fontcolor"] = gmember_textcolor
|
||||
LabelMetaFunctions.GetMembers ["fontface"] = gmember_textfont
|
||||
LabelMetaFunctions.GetMembers ["fontsize"] = gmember_textsize
|
||||
LabelMetaFunctions.GetMembers ["textcolor"] = gmember_textcolor --alias
|
||||
LabelMetaFunctions.GetMembers ["textfont"] = gmember_textfont --alias
|
||||
LabelMetaFunctions.GetMembers ["textsize"] = gmember_textsize --alias
|
||||
|
||||
LabelMetaFunctions.__index = function (_table, _member_requested)
|
||||
|
||||
local func = get_members_function_index [_member_requested]
|
||||
local func = LabelMetaFunctions.GetMembers [_member_requested]
|
||||
if (func) then
|
||||
return func (_table, _member_requested)
|
||||
end
|
||||
@@ -157,27 +166,26 @@ local LabelMetaFunctions = {}
|
||||
DF:SetFontOutline (_object.label, _value)
|
||||
end
|
||||
|
||||
local set_members_function_index = {
|
||||
["show"] = smember_show,
|
||||
["hide"] = smember_hide,
|
||||
["align"] = smember_textalign,
|
||||
["valign"] = smember_textvalign,
|
||||
["text"] = smember_text,
|
||||
["width"] = smember_width,
|
||||
["height"] = smember_height,
|
||||
["fontcolor"] = smember_textcolor,
|
||||
["color"] = smember_textcolor,--alias
|
||||
["fontface"] = smember_textfont,
|
||||
["fontsize"] = smember_textsize,
|
||||
["textcolor"] = smember_textcolor,--alias
|
||||
["textfont"] = smember_textfont,--alias
|
||||
["textsize"] = smember_textsize,--alias
|
||||
["shadow"] = smember_outline,
|
||||
["outline"] = smember_outline,--alias
|
||||
}
|
||||
LabelMetaFunctions.SetMembers = LabelMetaFunctions.SetMembers or {}
|
||||
LabelMetaFunctions.SetMembers["show"] = smember_show
|
||||
LabelMetaFunctions.SetMembers["hide"] = smember_hide
|
||||
LabelMetaFunctions.SetMembers["align"] = smember_textalign
|
||||
LabelMetaFunctions.SetMembers["valign"] = smember_textvalign
|
||||
LabelMetaFunctions.SetMembers["text"] = smember_text
|
||||
LabelMetaFunctions.SetMembers["width"] = smember_width
|
||||
LabelMetaFunctions.SetMembers["height"] = smember_height
|
||||
LabelMetaFunctions.SetMembers["fontcolor"] = smember_textcolor
|
||||
LabelMetaFunctions.SetMembers["color"] = smember_textcolor--alias
|
||||
LabelMetaFunctions.SetMembers["fontface"] = smember_textfont
|
||||
LabelMetaFunctions.SetMembers["fontsize"] = smember_textsize
|
||||
LabelMetaFunctions.SetMembers["textcolor"] = smember_textcolor--alias
|
||||
LabelMetaFunctions.SetMembers["textfont"] = smember_textfont--alias
|
||||
LabelMetaFunctions.SetMembers["textsize"] = smember_textsize--alias
|
||||
LabelMetaFunctions.SetMembers["shadow"] = smember_outline
|
||||
LabelMetaFunctions.SetMembers["outline"] = smember_outline--alias
|
||||
|
||||
LabelMetaFunctions.__newindex = function (_table, _key, _value)
|
||||
local func = set_members_function_index [_key]
|
||||
local func = LabelMetaFunctions.SetMembers [_key]
|
||||
if (func) then
|
||||
return func (_table, _value)
|
||||
else
|
||||
@@ -305,7 +313,8 @@ function DF:NewLabel (parent, container, name, member, text, font, size, color,
|
||||
DF:SetFontSize (LabelObject.label, size)
|
||||
end
|
||||
|
||||
|
||||
LabelObject.HookList = {
|
||||
}
|
||||
|
||||
LabelObject.label:SetJustifyH ("LEFT")
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<Script file="picture.lua"/>
|
||||
<Script file="slider.lua"/>
|
||||
<Script file="scrollbar.lua"/>
|
||||
<Script file="math.lua"/>
|
||||
|
||||
<Include file="tutorial_alert.xml"/>
|
||||
<Include file="split_bar.xml"/>
|
||||
|
||||
+52
-4
@@ -1,18 +1,66 @@
|
||||
|
||||
|
||||
local DF = _G ["DetailsFramework"]
|
||||
if (not DF or not DetailsFrameworkCanLoad) then
|
||||
return
|
||||
end
|
||||
|
||||
function DF:UnitDistance (unit1, unit2)
|
||||
local UnitExists = UnitExists
|
||||
local atan2 = math.atan2
|
||||
local pi = math.pi
|
||||
|
||||
--find distance between two players
|
||||
function DF:GetDistance_Unit (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
|
||||
local dX = u2X - u1X
|
||||
local dY = u2Y - u1Y
|
||||
|
||||
return sqrt ((dX*dX) + (dY*dY))
|
||||
return ((dX*dX) + (dY*dY)) ^ .5
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
--find distance between two points
|
||||
function DF:GetDistance_Point (x1, y1, x2, y2)
|
||||
local dx = x2 - x1
|
||||
local dy = y2 - y1
|
||||
return ((dx * dx) + (dy * dy)) ^ .5
|
||||
end
|
||||
|
||||
--find a rotation for an object from a point to another point
|
||||
function DF:FindLookAtRotation (x1, y1, x2, y2)
|
||||
return atan2 (y2 - y1, x2 - x1) + pi
|
||||
end
|
||||
|
||||
--find the value scale between two given values. e.g: value of 500 in a range 0-100 result in 10 in a scale for 0-10
|
||||
function DF:MapRangeClamped (inputX, inputY, outputX, outputY, value)
|
||||
return DF:GetRangeValue (outputX, outputY, Clamp (DF:GetRangePercent (inputX, inputY, value), 0, 1))
|
||||
end
|
||||
|
||||
--find the value scale between two given values. e.g: value of 75 in a range 0-100 result in 7.5 in a scale for 0-10
|
||||
function DF:MapRangeUnclamped (inputX, inputY, outputX, outputY, value)
|
||||
return DF:GetRangeValue (outputX, outputY, DF:GetRangePercent (inputX, inputY, value))
|
||||
end
|
||||
|
||||
--find the normalized percent fo the value in the range. e.g range of 200-400 and a value of 250 result in 0.25
|
||||
function DF:GetRangePercent (minValue, maxValue, value)
|
||||
return (value - minValue) / (maxValue - minValue)
|
||||
end
|
||||
|
||||
--find the value in the range given from a normalized percent. e.g range of 200-400 and a percent of 0.8 result in 360
|
||||
function DF:GetRangeValue (minValue, maxValue, percent)
|
||||
return Lerp (minValue, maxValue, percent)
|
||||
end
|
||||
|
||||
--dot product of two vectors
|
||||
function DF:GetDotProduct (v1, v2)
|
||||
return (v1.x * v2.x) + (v1.y * v2.y)
|
||||
end
|
||||
|
||||
--normalized value 0-1 result in the value on the range given, e.g 200-400 range with a value of .5 result in 300
|
||||
function DF:LerpNorm (minValue, maxValue, value)
|
||||
return (minValue + value * (maxValue - minValue))
|
||||
end
|
||||
+83
-90
@@ -15,9 +15,20 @@ local _math_floor = math.floor --> lua locals
|
||||
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
|
||||
|
||||
local cleanfunction = function() end
|
||||
local BarMetaFunctions = {}
|
||||
local APIBarFunctions
|
||||
|
||||
do
|
||||
local metaPrototype = {
|
||||
WidgetType = "normal_bar",
|
||||
SetHook = DF.SetHook,
|
||||
RunHooksForWidget = DF.RunHooksForWidget,
|
||||
}
|
||||
|
||||
_G [DF.GlobalWidgetControlNames ["normal_bar"]] = _G [DF.GlobalWidgetControlNames ["normal_bar"]] or metaPrototype
|
||||
end
|
||||
|
||||
local BarMetaFunctions = _G [DF.GlobalWidgetControlNames ["normal_bar"]]
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> metatables
|
||||
|
||||
@@ -111,28 +122,27 @@ local APIBarFunctions
|
||||
return _object.textleft:GetTextColor()
|
||||
end
|
||||
|
||||
local get_members_function_index = {
|
||||
["tooltip"] = gmember_tooltip,
|
||||
["shown"] = gmember_shown,
|
||||
["width"] = gmember_width,
|
||||
["height"] = gmember_height,
|
||||
["value"] = gmember_value,
|
||||
["lefttext"] = gmember_ltext,
|
||||
["righttext"] = gmember_rtext,
|
||||
["color"] = gmember_color,
|
||||
["icon"] = gmember_icon,
|
||||
["texture"] = gmember_texture,
|
||||
["fontsize"] = gmember_textsize,
|
||||
["fontface"] = gmember_textfont,
|
||||
["fontcolor"] = gmember_textcolor,
|
||||
["textsize"] = gmember_textsize, --alias
|
||||
["textfont"] = gmember_textfont, --alias
|
||||
["textcolor"] = gmember_textcolor --alias
|
||||
}
|
||||
BarMetaFunctions.GetMembers = BarMetaFunctions.GetMembers or {}
|
||||
BarMetaFunctions.GetMembers ["tooltip"] = gmember_tooltip
|
||||
BarMetaFunctions.GetMembers ["shown"] = gmember_shown
|
||||
BarMetaFunctions.GetMembers ["width"] = gmember_width
|
||||
BarMetaFunctions.GetMembers ["height"] = gmember_height
|
||||
BarMetaFunctions.GetMembers ["value"] = gmember_value
|
||||
BarMetaFunctions.GetMembers ["lefttext"] = gmember_ltext
|
||||
BarMetaFunctions.GetMembers ["righttext"] = gmember_rtext
|
||||
BarMetaFunctions.GetMembers ["color"] = gmember_color
|
||||
BarMetaFunctions.GetMembers ["icon"] = gmember_icon
|
||||
BarMetaFunctions.GetMembers ["texture"] = gmember_texture
|
||||
BarMetaFunctions.GetMembers ["fontsize"] = gmember_textsize
|
||||
BarMetaFunctions.GetMembers ["fontface"] = gmember_textfont
|
||||
BarMetaFunctions.GetMembers ["fontcolor"] = gmember_textcolor
|
||||
BarMetaFunctions.GetMembers ["textsize"] = gmember_textsize --alias
|
||||
BarMetaFunctions.GetMembers ["textfont"] = gmember_textfont --alias
|
||||
BarMetaFunctions.GetMembers ["textcolor"] = gmember_textcolor --alias
|
||||
|
||||
BarMetaFunctions.__index = function (_table, _member_requested)
|
||||
|
||||
local func = get_members_function_index [_member_requested]
|
||||
local func = BarMetaFunctions.GetMembers [_member_requested]
|
||||
if (func) then
|
||||
return func (_table, _member_requested)
|
||||
end
|
||||
@@ -267,30 +277,29 @@ local APIBarFunctions
|
||||
return DF:SetFontOutline (_object.textright, _value)
|
||||
end
|
||||
|
||||
local set_members_function_index = {
|
||||
["tooltip"] = smember_tooltip,
|
||||
["shown"] = smember_shown,
|
||||
["width"] = smember_width,
|
||||
["height"] = smember_height,
|
||||
["value"] = smember_value,
|
||||
["righttext"] = smember_rtext,
|
||||
["lefttext"] = smember_ltext,
|
||||
["color"] = smember_color,
|
||||
["icon"] = smember_icon,
|
||||
["texture"] = smember_texture,
|
||||
["fontsize"] = smember_textsize,
|
||||
["fontface"] = smember_textfont,
|
||||
["fontcolor"] = smember_textcolor,
|
||||
["textsize"] = smember_textsize, --alias
|
||||
["textfont"] = smember_textfont, --alias
|
||||
["textcolor"] = smember_textcolor, --alias
|
||||
["shadow"] = smember_outline,
|
||||
["outline"] = smember_outline, --alias
|
||||
}
|
||||
BarMetaFunctions.SetMembers = BarMetaFunctions.SetMembers or {}
|
||||
BarMetaFunctions.SetMembers["tooltip"] = smember_tooltip
|
||||
BarMetaFunctions.SetMembers["shown"] = smember_shown
|
||||
BarMetaFunctions.SetMembers["width"] = smember_width
|
||||
BarMetaFunctions.SetMembers["height"] = smember_height
|
||||
BarMetaFunctions.SetMembers["value"] = smember_value
|
||||
BarMetaFunctions.SetMembers["righttext"] = smember_rtext
|
||||
BarMetaFunctions.SetMembers["lefttext"] = smember_ltext
|
||||
BarMetaFunctions.SetMembers["color"] = smember_color
|
||||
BarMetaFunctions.SetMembers["icon"] = smember_icon
|
||||
BarMetaFunctions.SetMembers["texture"] = smember_texture
|
||||
BarMetaFunctions.SetMembers["fontsize"] = smember_textsize
|
||||
BarMetaFunctions.SetMembers["fontface"] = smember_textfont
|
||||
BarMetaFunctions.SetMembers["fontcolor"] = smember_textcolor
|
||||
BarMetaFunctions.SetMembers["textsize"] = smember_textsize --alias
|
||||
BarMetaFunctions.SetMembers["textfont"] = smember_textfont --alias
|
||||
BarMetaFunctions.SetMembers["textcolor"] = smember_textcolor --alias
|
||||
BarMetaFunctions.SetMembers["shadow"] = smember_outline
|
||||
BarMetaFunctions.SetMembers["outline"] = smember_outline --alias
|
||||
|
||||
BarMetaFunctions.__newindex = function (_table, _key, _value)
|
||||
|
||||
local func = set_members_function_index [_key]
|
||||
local func = BarMetaFunctions.SetMembers [_key]
|
||||
if (func) then
|
||||
return func (_table, _value)
|
||||
else
|
||||
@@ -420,24 +429,14 @@ local APIBarFunctions
|
||||
self.container = container
|
||||
end
|
||||
|
||||
--> hooks
|
||||
function BarMetaFunctions:SetHook (hookType, func)
|
||||
if (func) then
|
||||
_rawset (self, hookType.."Hook", func)
|
||||
else
|
||||
_rawset (self, hookType.."Hook", nil)
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> scripts
|
||||
|
||||
local OnEnter = function (frame)
|
||||
if (frame.MyObject.OnEnterHook) then
|
||||
local interrupt = frame.MyObject.OnEnterHook (frame, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnEnter", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
frame.MyObject.background:Show()
|
||||
@@ -451,11 +450,10 @@ local APIBarFunctions
|
||||
end
|
||||
|
||||
local OnLeave = function (frame)
|
||||
if (frame.MyObject.OnLeaveHook) then
|
||||
local interrupt = frame.MyObject.OnLeaveHook (frame)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnLeave", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.MyObject.have_tooltip) then
|
||||
@@ -464,29 +462,26 @@ local APIBarFunctions
|
||||
end
|
||||
|
||||
local OnHide = function (frame)
|
||||
if (frame.MyObject.OnHideHook) then
|
||||
local interrupt = frame.MyObject.OnHideHook (frame)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnHide", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnShow = function (frame)
|
||||
if (frame.MyObject.OnShowHook) then
|
||||
local interrupt = frame.MyObject.OnShowHook (frame)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnShow", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnMouseDown = function (frame, button)
|
||||
if (frame.MyObject.OnMouseDownHook) then
|
||||
local interrupt = frame.MyObject.OnMouseDownHook (frame, button)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseDown", frame, button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (not frame.MyObject.container.isLocked and frame.MyObject.container:IsMovable()) then
|
||||
@@ -498,11 +493,10 @@ local APIBarFunctions
|
||||
end
|
||||
|
||||
local OnMouseUp = function (frame, button)
|
||||
if (frame.MyObject.OnMouseUpHook) then
|
||||
local interrupt = frame.MyObject.OnMouseUpHook (frame, button)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseUp", frame, button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.MyObject.container.isMoving) then
|
||||
@@ -674,18 +668,8 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name)
|
||||
h = h or 14
|
||||
|
||||
--> default members:
|
||||
--> hooks
|
||||
BarObject.OnEnterHook = nil
|
||||
BarObject.OnLeaveHook = nil
|
||||
BarObject.OnHideHook = nil
|
||||
BarObject.OnShowHook = nil
|
||||
BarObject.OnMouseDownHook = nil
|
||||
BarObject.OnMouseUpHook = nil
|
||||
BarObject.OnTimerEndHook = nil
|
||||
--> misc
|
||||
BarObject.tooltip = nil
|
||||
BarObject.locked = false
|
||||
BarObject.have_tooltip = nil
|
||||
|
||||
BarObject.container = container
|
||||
|
||||
@@ -729,6 +713,15 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name)
|
||||
BarObject.div_timer = _G [name .. "_sparkTimer"]
|
||||
|
||||
--> hooks
|
||||
BarObject.HookList = {
|
||||
OnEnter = {},
|
||||
OnLeave = {},
|
||||
OnHide = {},
|
||||
OnShow = {},
|
||||
OnMouseDown = {},
|
||||
OnMouseUp = {},
|
||||
}
|
||||
|
||||
BarObject.statusbar:SetScript ("OnEnter", OnEnter)
|
||||
BarObject.statusbar:SetScript ("OnLeave", OnLeave)
|
||||
BarObject.statusbar:SetScript ("OnHide", OnHide)
|
||||
|
||||
+337
-81
@@ -15,9 +15,20 @@ local _math_floor = math.floor --> lua local
|
||||
local loadstring = loadstring --> lua local
|
||||
|
||||
local cleanfunction = function() end
|
||||
local PanelMetaFunctions = {}
|
||||
local APIFrameFunctions
|
||||
|
||||
do
|
||||
local metaPrototype = {
|
||||
WidgetType = "panel",
|
||||
SetHook = DF.SetHook,
|
||||
RunHooksForWidget = DF.RunHooksForWidget,
|
||||
}
|
||||
|
||||
_G [DF.GlobalWidgetControlNames ["panel"]] = _G [DF.GlobalWidgetControlNames ["panel"]] or metaPrototype
|
||||
end
|
||||
|
||||
local PanelMetaFunctions = _G [DF.GlobalWidgetControlNames ["panel"]]
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> metatables
|
||||
|
||||
@@ -58,19 +69,18 @@ local APIFrameFunctions
|
||||
return _rawget (_object, "is_locked")
|
||||
end
|
||||
|
||||
local get_members_function_index = {
|
||||
["tooltip"] = gmember_tooltip,
|
||||
["shown"] = gmember_shown,
|
||||
["color"] = gmember_color,
|
||||
["backdrop"] = gmember_backdrop,
|
||||
["width"] = gmember_width,
|
||||
["height"] = gmember_height,
|
||||
["locked"] = gmember_locked,
|
||||
}
|
||||
PanelMetaFunctions.GetMembers = PanelMetaFunctions.GetMembers or {}
|
||||
PanelMetaFunctions.GetMembers ["tooltip"] = gmember_tooltip
|
||||
PanelMetaFunctions.GetMembers ["shown"] = gmember_shown
|
||||
PanelMetaFunctions.GetMembers ["color"] = gmember_color
|
||||
PanelMetaFunctions.GetMembers ["backdrop"] = gmember_backdrop
|
||||
PanelMetaFunctions.GetMembers ["width"] = gmember_width
|
||||
PanelMetaFunctions.GetMembers ["height"] = gmember_height
|
||||
PanelMetaFunctions.GetMembers ["locked"] = gmember_locked
|
||||
|
||||
PanelMetaFunctions.__index = function (_table, _member_requested)
|
||||
|
||||
local func = get_members_function_index [_member_requested]
|
||||
local func = PanelMetaFunctions.GetMembers [_member_requested]
|
||||
if (func) then
|
||||
return func (_table, _member_requested)
|
||||
end
|
||||
@@ -140,20 +150,19 @@ local APIFrameFunctions
|
||||
return _rawset (_object, "rightButtonClose", _value)
|
||||
end
|
||||
|
||||
local set_members_function_index = {
|
||||
["tooltip"] = smember_tooltip,
|
||||
["show"] = smember_show,
|
||||
["hide"] = smember_hide,
|
||||
["color"] = smember_color,
|
||||
["backdrop"] = smember_backdrop,
|
||||
["width"] = smember_width,
|
||||
["height"] = smember_height,
|
||||
["locked"] = smember_locked,
|
||||
["close_with_right"] = smember_right_close,
|
||||
}
|
||||
|
||||
PanelMetaFunctions.SetMembers = PanelMetaFunctions.SetMembers or {}
|
||||
PanelMetaFunctions.SetMembers["tooltip"] = smember_tooltip
|
||||
PanelMetaFunctions.SetMembers["show"] = smember_show
|
||||
PanelMetaFunctions.SetMembers["hide"] = smember_hide
|
||||
PanelMetaFunctions.SetMembers["color"] = smember_color
|
||||
PanelMetaFunctions.SetMembers["backdrop"] = smember_backdrop
|
||||
PanelMetaFunctions.SetMembers["width"] = smember_width
|
||||
PanelMetaFunctions.SetMembers["height"] = smember_height
|
||||
PanelMetaFunctions.SetMembers["locked"] = smember_locked
|
||||
PanelMetaFunctions.SetMembers["close_with_right"] = smember_right_close
|
||||
|
||||
PanelMetaFunctions.__newindex = function (_table, _key, _value)
|
||||
local func = set_members_function_index [_key]
|
||||
local func = PanelMetaFunctions.SetMembers [_key]
|
||||
if (func) then
|
||||
return func (_table, _value)
|
||||
else
|
||||
@@ -309,24 +318,14 @@ local APIFrameFunctions
|
||||
end
|
||||
end
|
||||
|
||||
--> hooks
|
||||
function PanelMetaFunctions:SetHook (hookType, func)
|
||||
if (func) then
|
||||
_rawset (self, hookType.."Hook", func)
|
||||
else
|
||||
_rawset (self, hookType.."Hook", nil)
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> scripts
|
||||
|
||||
local OnEnter = function (frame)
|
||||
if (frame.MyObject.OnEnterHook) then
|
||||
local interrupt = frame.MyObject.OnEnterHook (frame, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnEnter", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.MyObject.have_tooltip) then
|
||||
@@ -340,11 +339,10 @@ local APIFrameFunctions
|
||||
end
|
||||
|
||||
local OnLeave = function (frame)
|
||||
if (frame.MyObject.OnLeaveHook) then
|
||||
local interrupt = frame.MyObject.OnLeaveHook (frame, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnLeave", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.MyObject.have_tooltip) then
|
||||
@@ -354,29 +352,26 @@ local APIFrameFunctions
|
||||
end
|
||||
|
||||
local OnHide = function (frame)
|
||||
if (frame.MyObject.OnHideHook) then
|
||||
local interrupt = frame.MyObject.OnHideHook (frame, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnHide", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnShow = function (frame)
|
||||
if (frame.MyObject.OnShowHook) then
|
||||
local interrupt = frame.MyObject.OnShowHook (frame, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnShow", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnMouseDown = function (frame, button)
|
||||
if (frame.MyObject.OnMouseDownHook) then
|
||||
local interrupt = frame.MyObject.OnMouseDownHook (frame, button, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseDown", frame, button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.MyObject.container == UIParent) then
|
||||
@@ -396,11 +391,10 @@ local APIFrameFunctions
|
||||
end
|
||||
|
||||
local OnMouseUp = function (frame, button)
|
||||
if (frame.MyObject.OnMouseUpHook) then
|
||||
local interrupt = frame.MyObject.OnMouseUpHook (frame, button, frame.MyObject)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseUp", frame, button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (button == "RightButton" and frame.MyObject.rightButtonClose) then
|
||||
@@ -456,15 +450,7 @@ function DF:NewPanel (parent, container, name, member, w, h, backdrop, backdropc
|
||||
container = container.widget
|
||||
end
|
||||
|
||||
|
||||
--> default members:
|
||||
--> hooks
|
||||
PanelObject.OnEnterHook = nil
|
||||
PanelObject.OnLeaveHook = nil
|
||||
PanelObject.OnHideHook = nil
|
||||
PanelObject.OnShowHook = nil
|
||||
PanelObject.OnMouseDownHook = nil
|
||||
PanelObject.OnMouseUpHook = nil
|
||||
--> misc
|
||||
PanelObject.is_locked = true
|
||||
PanelObject.container = container
|
||||
@@ -491,6 +477,15 @@ function DF:NewPanel (parent, container, name, member, w, h, backdrop, backdropc
|
||||
|
||||
PanelObject.frame.MyObject = PanelObject
|
||||
|
||||
PanelObject.HookList = {
|
||||
OnEnter = {},
|
||||
OnLeave = {},
|
||||
OnHide = {},
|
||||
OnShow = {},
|
||||
OnMouseDown = {},
|
||||
OnMouseUp = {},
|
||||
}
|
||||
|
||||
--> hooks
|
||||
PanelObject.frame:SetScript ("OnEnter", OnEnter)
|
||||
PanelObject.frame:SetScript ("OnLeave", OnLeave)
|
||||
@@ -968,8 +963,13 @@ function DF:NewFillPanel (parent, rows, name, member, w, h, total_lines, fill_ro
|
||||
iconwidget.line = index
|
||||
iconwidget.index = real_index
|
||||
|
||||
local result = results [index]:gsub (".-%\\", "")
|
||||
iconwidget._icon.texture = results [index]
|
||||
--print (index, results [index])
|
||||
if (type (results [index]) == "string") then
|
||||
local result = results [index]:gsub (".-%\\", "")
|
||||
iconwidget._icon.texture = results [index]
|
||||
else
|
||||
iconwidget._icon:SetTexture (results [index])
|
||||
end
|
||||
|
||||
iconwidget:Show()
|
||||
end
|
||||
@@ -1494,8 +1494,27 @@ local SimplePanel_frame_backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], e
|
||||
local SimplePanel_frame_backdrop_color = {0, 0, 0, 0.9}
|
||||
local SimplePanel_frame_backdrop_border_color = {0, 0, 0, 1}
|
||||
|
||||
function DF:CreateScaleBar (frame, config)
|
||||
local scaleBar = DF:CreateSlider (frame, 120, 14, 0.6, 1.6, 0.1, config.scale, true, "ScaleBar", nil, "Scale:", DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE"), DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE"))
|
||||
scaleBar:SetPoint ("right", frame.Close, "left", -2, 0)
|
||||
scaleBar:SetFrameLevel (DF.FRAMELEVEL_OVERLAY)
|
||||
scaleBar.OnValueChanged = function (_, _, value)
|
||||
config.scale = value
|
||||
if (not scaleBar.IsValueChanging) then
|
||||
frame:SetScale (config.scale)
|
||||
end
|
||||
end
|
||||
scaleBar:SetHook ("OnMouseUp", function()
|
||||
frame:SetScale (config.scale)
|
||||
end)
|
||||
end
|
||||
|
||||
local no_options = {}
|
||||
function DF:CreateSimplePanel (parent, w, h, title, name, panel_options)
|
||||
function DF:CreateSimplePanel (parent, w, h, title, name, panel_options, db)
|
||||
|
||||
if (db and name and not db [name]) then
|
||||
db [name] = {scale = 1}
|
||||
end
|
||||
|
||||
if (not name) then
|
||||
name = "DetailsFrameworkSimplePanel" .. DF.SimplePanelCounter
|
||||
@@ -1533,6 +1552,7 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options)
|
||||
f.TitleBar = title_bar
|
||||
|
||||
local close = CreateFrame ("button", name and name .. "CloseButton", title_bar)
|
||||
close:SetFrameLevel (DF.FRAMELEVEL_OVERLAY)
|
||||
close:SetSize (16, 16)
|
||||
close:SetNormalTexture (DF.folder .. "icons")
|
||||
close:SetHighlightTexture (DF.folder .. "icons")
|
||||
@@ -1549,6 +1569,11 @@ function DF:CreateSimplePanel (parent, w, h, title, name, panel_options)
|
||||
title_string:SetText (title or "")
|
||||
f.Title = title_string
|
||||
|
||||
if (panel_options.UseScaleBar and db [name]) then
|
||||
DF:CreateScaleBar (f, db [name])
|
||||
f:SetScale (db [name].scale)
|
||||
end
|
||||
|
||||
f.Title:SetPoint ("center", title_bar, "center")
|
||||
f.Close:SetPoint ("right", title_bar, "right", -2, 0)
|
||||
|
||||
@@ -2477,7 +2502,7 @@ local chart_panel_add_label = function (self, color, name, type, number)
|
||||
thisbox.type = type
|
||||
thisbox.index = number
|
||||
|
||||
thisbox.box:SetTexture (unpack (color))
|
||||
thisbox.box:SetColorTexture (unpack (color))
|
||||
thisbox.text:SetText (name)
|
||||
|
||||
thisbox.check:Show()
|
||||
@@ -2519,7 +2544,7 @@ local draw_overlay = function (self, this_overlay, overlayData, color)
|
||||
this_block:SetWidth (pixel*5)
|
||||
end
|
||||
|
||||
this_block:SetTexture (r, g, b, 0.25)
|
||||
this_block:SetColorTexture (r, g, b, 0.25)
|
||||
this_block:Show()
|
||||
|
||||
index = index + 1
|
||||
@@ -2831,7 +2856,7 @@ function DF:CreateChartPanel (parent, w, h, name)
|
||||
title:SetPoint ("topleft", f, "topleft", 110, -13)
|
||||
|
||||
local bottom_texture = DF:NewImage (f, nil, 702, 25, "background", nil, nil, "$parentBottomTexture")
|
||||
bottom_texture:SetTexture (0, 0, 0, .6)
|
||||
bottom_texture:SetColorTexture (0, 0, 0, .6)
|
||||
bottom_texture:SetPoint ("bottomleft", f, "bottomleft", 8, 7)
|
||||
bottom_texture:SetPoint ("bottomright", f, "bottomright", -8, 7)
|
||||
|
||||
@@ -2850,7 +2875,7 @@ function DF:CreateChartPanel (parent, w, h, name)
|
||||
|
||||
local line = f:CreateTexture (nil, "border")
|
||||
line:SetSize (1, h-45)
|
||||
line:SetTexture (1, 1, 1, .1)
|
||||
line:SetColorTexture (1, 1, 1, .1)
|
||||
line:SetPoint ("bottomleft", time, "topright", 0, -10)
|
||||
line:Hide()
|
||||
time.line = line
|
||||
@@ -2882,7 +2907,7 @@ function DF:CreateChartPanel (parent, w, h, name)
|
||||
--div lines
|
||||
for i = 1, 8, 1 do
|
||||
local line = g:CreateTexture (nil, "overlay")
|
||||
line:SetTexture (1, 1, 1, .2)
|
||||
line:SetColorTexture (1, 1, 1, .2)
|
||||
line:SetWidth (670)
|
||||
line:SetHeight (1.1)
|
||||
|
||||
@@ -2966,7 +2991,7 @@ local gframe_create_line = function (self)
|
||||
t:SetWidth (1)
|
||||
t:SetPoint ("topright", f, "topright")
|
||||
t:SetPoint ("bottomright", f, "bottomright")
|
||||
t:SetTexture (1, 1, 1, .1)
|
||||
t:SetColorTexture (1, 1, 1, .1)
|
||||
f.grid = t
|
||||
|
||||
local b = f:CreateTexture (nil, "overlay")
|
||||
@@ -3080,4 +3105,235 @@ function DF:CreateGFrame (parent, w, h, linewidth, onenter, onleave, member, nam
|
||||
f._maxlines = floor (f:GetWidth() / f._linewidth)
|
||||
|
||||
return f
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
-- ~buttoncontainer
|
||||
|
||||
function DF:CreateButtonContainer (parent, name)
|
||||
local f = CreateFrame ("frame", name, parent)
|
||||
-- f.
|
||||
end
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
--> options tabs and buttons -dot
|
||||
|
||||
function DF:FindHighestParent (self)
|
||||
local f
|
||||
if (self:GetParent() == UIParent) then
|
||||
f = self
|
||||
end
|
||||
if (not f) then
|
||||
f = self
|
||||
for i = 1, 6 do
|
||||
local parent = f:GetParent()
|
||||
if (parent == UIParent) then
|
||||
break
|
||||
else
|
||||
f = parent
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return f
|
||||
end
|
||||
|
||||
DF.TabContainerFunctions = {}
|
||||
|
||||
local button_tab_template = DF.table.copy ({}, DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE"))
|
||||
button_tab_template.backdropbordercolor = nil
|
||||
|
||||
DF.TabContainerFunctions.CreateUnderlineGlow = function (button)
|
||||
local selectedGlow = button:CreateTexture (nil, "background", -4)
|
||||
selectedGlow:SetPoint ("topleft", button.widget, "bottomleft", -7, 0)
|
||||
selectedGlow:SetPoint ("topright", button.widget, "bottomright", 7, 0)
|
||||
selectedGlow:SetTexture ([[Interface\BUTTONS\UI-Panel-Button-Glow]])
|
||||
selectedGlow:SetTexCoord (0, 95/128, 30/64, 38/64)
|
||||
selectedGlow:SetBlendMode ("ADD")
|
||||
selectedGlow:SetHeight (8)
|
||||
selectedGlow:SetAlpha (.75)
|
||||
selectedGlow:Hide()
|
||||
button.selectedUnderlineGlow = selectedGlow
|
||||
end
|
||||
|
||||
DF.TabContainerFunctions.OnMouseDown = function (self, button)
|
||||
--> search for UIParent
|
||||
local f = DF:FindHighestParent (self)
|
||||
local container = self:GetParent()
|
||||
|
||||
if (button == "LeftButton") then
|
||||
if (not f.IsMoving and f:IsMovable()) then
|
||||
f:StartMoving()
|
||||
f.IsMoving = true
|
||||
end
|
||||
elseif (button == "RightButton") then
|
||||
if (not f.IsMoving and container.IsContainer) then
|
||||
if (self.IsFrontPage) then
|
||||
if (container.CanCloseWithRightClick) then
|
||||
if (f.CloseFunction) then
|
||||
f:CloseFunction()
|
||||
else
|
||||
f:Hide()
|
||||
end
|
||||
end
|
||||
else
|
||||
--goes back to front page
|
||||
DF.TabContainerFunctions.SelectIndex (self, _, 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
DF.TabContainerFunctions.OnMouseUp = function (self, button)
|
||||
local f = DF:FindHighestParent (self)
|
||||
if (f.IsMoving) then
|
||||
f:StopMovingOrSizing()
|
||||
f.IsMoving = false
|
||||
end
|
||||
end
|
||||
|
||||
DF.TabContainerFunctions.SelectIndex = function (self, fixedParam, menuIndex)
|
||||
local mainFrame = self.AllFrames and self or self.mainFrame or self:GetParent()
|
||||
|
||||
for i = 1, #mainFrame.AllFrames do
|
||||
mainFrame.AllFrames[i]:Hide()
|
||||
if (mainFrame.ButtonNotSelectedBorderColor) then
|
||||
mainFrame.AllButtons[i]:SetBackdropBorderColor (unpack (mainFrame.ButtonNotSelectedBorderColor))
|
||||
end
|
||||
if (mainFrame.AllButtons[i].selectedUnderlineGlow) then
|
||||
mainFrame.AllButtons[i].selectedUnderlineGlow:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
mainFrame.AllFrames[menuIndex]:Show()
|
||||
if (mainFrame.ButtonSelectedBorderColor) then
|
||||
mainFrame.AllButtons[menuIndex]:SetBackdropBorderColor (unpack (mainFrame.ButtonSelectedBorderColor))
|
||||
end
|
||||
if (mainFrame.AllButtons[menuIndex].selectedUnderlineGlow) then
|
||||
mainFrame.AllButtons[menuIndex].selectedUnderlineGlow:Show()
|
||||
end
|
||||
mainFrame.CurrentIndex = menuIndex
|
||||
end
|
||||
|
||||
DF.TabContainerFunctions.SetIndex = function (self, index)
|
||||
self.CurrentIndex = index
|
||||
end
|
||||
|
||||
local tab_container_on_show = function (self)
|
||||
local index = self.CurrentIndex
|
||||
self.SelectIndex (self.AllButtons[index], nil, index)
|
||||
end
|
||||
|
||||
function DF:CreateTabContainer (parent, title, frame_name, frame_list, options_table)
|
||||
|
||||
local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")
|
||||
local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
|
||||
local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")
|
||||
local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")
|
||||
local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
|
||||
|
||||
options_table = options_table or {}
|
||||
local frame_width = parent:GetWidth()
|
||||
local frame_height = parent:GetHeight()
|
||||
local y_offset = options_table.y_offset or 0
|
||||
local button_width = options_table.button_width or 160
|
||||
local button_height = options_table.button_height or 20
|
||||
local button_anchor_x = options_table.button_x or 230
|
||||
local button_anchor_y = options_table.button_y or -32
|
||||
local button_text_size = options_table.button_text_size or 10
|
||||
|
||||
local mainFrame = CreateFrame ("frame", frame_name, parent.widget or parent)
|
||||
mainFrame:SetAllPoints()
|
||||
DF:Mixin (mainFrame, DF.TabContainerFunctions)
|
||||
|
||||
local mainTitle = DF:CreateLabel (mainFrame, title, 24, "white")
|
||||
mainTitle:SetPoint ("topleft", mainFrame, "topleft", 10, -30 + y_offset)
|
||||
|
||||
mainFrame:SetFrameLevel (200)
|
||||
|
||||
mainFrame.AllFrames = {}
|
||||
mainFrame.AllButtons = {}
|
||||
mainFrame.CurrentIndex = 1
|
||||
mainFrame.IsContainer = true
|
||||
mainFrame.ButtonSelectedBorderColor = options_table.button_selected_border_color or {1, 1, 0, 1}
|
||||
mainFrame.ButtonNotSelectedBorderColor = options_table.button_border_color or {0, 0, 0, 0}
|
||||
|
||||
if (options_table.right_click_interact ~= nil) then
|
||||
mainFrame.CanCloseWithRightClick = options_table.right_click_interact
|
||||
else
|
||||
mainFrame.CanCloseWithRightClick = true
|
||||
end
|
||||
|
||||
for i, frame in ipairs (frame_list) do
|
||||
local f = CreateFrame ("frame", "$parent" .. frame.name, mainFrame)
|
||||
f:SetAllPoints()
|
||||
f:SetFrameLevel (210)
|
||||
f:Hide()
|
||||
|
||||
local title = DF:CreateLabel (f, frame.title, 16, "silver")
|
||||
title:SetPoint ("topleft", mainTitle, "bottomleft", 0, 0)
|
||||
|
||||
local tabButton = DF:CreateButton (mainFrame, DF.TabContainerFunctions.SelectIndex, button_width, button_height, frame.title, i, nil, nil, nil, nil, false, button_tab_template)
|
||||
tabButton:SetFrameLevel (220)
|
||||
tabButton.textsize = button_text_size
|
||||
tabButton.mainFrame = mainFrame
|
||||
DF.TabContainerFunctions.CreateUnderlineGlow (tabButton)
|
||||
|
||||
if (i == 1) then
|
||||
local right_click_to_back = DF:CreateLabel (f, "right click to close", 10, "gray")
|
||||
right_click_to_back:SetPoint ("bottomright", f, "bottomright", -1, 0)
|
||||
f.IsFrontPage = true
|
||||
else
|
||||
local right_click_to_back = DF:CreateLabel (f, "right click to go back to main menu", 10, "gray")
|
||||
right_click_to_back:SetPoint ("bottomright", f, "bottomright", -1, 0)
|
||||
end
|
||||
|
||||
f:SetScript ("OnMouseDown", DF.TabContainerFunctions.OnMouseDown)
|
||||
f:SetScript ("OnMouseUp", DF.TabContainerFunctions.OnMouseUp)
|
||||
|
||||
tinsert (mainFrame.AllFrames, f)
|
||||
tinsert (mainFrame.AllButtons, tabButton)
|
||||
end
|
||||
|
||||
--order buttons
|
||||
local x = button_anchor_x
|
||||
local y = button_anchor_y
|
||||
local space_for_buttons = frame_width - (#frame_list*3) - button_anchor_x
|
||||
local amount_buttons_per_row = floor (space_for_buttons / button_width)
|
||||
local last_button = mainFrame.AllButtons[1]
|
||||
|
||||
mainFrame.AllButtons[1]:SetPoint ("topleft", mainTitle, "topleft", x, y)
|
||||
x = x + button_width + 2
|
||||
|
||||
for i = 2, #mainFrame.AllButtons do
|
||||
local button = mainFrame.AllButtons [i]
|
||||
button:SetPoint ("topleft", mainTitle, "topleft", x, y)
|
||||
x = x + button_width + 2
|
||||
|
||||
if (i % amount_buttons_per_row == 0) then
|
||||
x = button_anchor_x
|
||||
y = y - button_height - 1
|
||||
end
|
||||
end
|
||||
|
||||
--> when show the frame, reset to the current internal index
|
||||
mainFrame:SetScript ("OnShow", tab_container_on_show)
|
||||
--> select the first frame
|
||||
mainFrame.SelectIndex (mainFrame.AllButtons[1], nil, 1)
|
||||
|
||||
return mainFrame
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+35
-23
@@ -15,7 +15,18 @@ local loadstring = loadstring --> lua local
|
||||
|
||||
local cleanfunction = function() end
|
||||
local APIImageFunctions = false
|
||||
local ImageMetaFunctions = {}
|
||||
|
||||
do
|
||||
local metaPrototype = {
|
||||
WidgetType = "image",
|
||||
SetHook = DF.SetHook,
|
||||
RunHooksForWidget = DF.RunHooksForWidget,
|
||||
}
|
||||
|
||||
_G [DF.GlobalWidgetControlNames ["image"]] = _G [DF.GlobalWidgetControlNames ["image"]] or metaPrototype
|
||||
end
|
||||
|
||||
local ImageMetaFunctions = _G [DF.GlobalWidgetControlNames ["image"]]
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> metatables
|
||||
@@ -48,17 +59,16 @@ local ImageMetaFunctions = {}
|
||||
return _object.image:GetAlpha()
|
||||
end
|
||||
|
||||
local get_members_function_index = {
|
||||
["shown"] = gmember_shown,
|
||||
["alpha"] = gmember_alpha,
|
||||
["width"] = gmember_width,
|
||||
["height"] = gmember_height,
|
||||
["texture"] = gmember_texture,
|
||||
}
|
||||
|
||||
ImageMetaFunctions.GetMembers = ImageMetaFunctions.GetMembers or {}
|
||||
ImageMetaFunctions.GetMembers ["shown"] = gmember_shown
|
||||
ImageMetaFunctions.GetMembers ["alpha"] = gmember_alpha
|
||||
ImageMetaFunctions.GetMembers ["width"] = gmember_width
|
||||
ImageMetaFunctions.GetMembers ["height"] = gmember_height
|
||||
ImageMetaFunctions.GetMembers ["texture"] = gmember_texture
|
||||
|
||||
ImageMetaFunctions.__index = function (_table, _member_requested)
|
||||
|
||||
local func = get_members_function_index [_member_requested]
|
||||
local func = ImageMetaFunctions.GetMembers [_member_requested]
|
||||
if (func) then
|
||||
return func (_table, _member_requested)
|
||||
end
|
||||
@@ -146,20 +156,19 @@ local ImageMetaFunctions = {}
|
||||
end
|
||||
end
|
||||
|
||||
local set_members_function_index = {
|
||||
["show"] = smember_show,
|
||||
["hide"] = smember_hide,
|
||||
["alpha"] = smember_alpha,
|
||||
["width"] = smember_width,
|
||||
["height"] = smember_height,
|
||||
["texture"] = smember_texture,
|
||||
["texcoord"] = smember_texcoord,
|
||||
["color"] = smember_color,
|
||||
["blackwhite"] = smember_desaturated,
|
||||
}
|
||||
|
||||
ImageMetaFunctions.SetMembers = ImageMetaFunctions.SetMembers or {}
|
||||
ImageMetaFunctions.SetMembers ["show"] = smember_show
|
||||
ImageMetaFunctions.SetMembers ["hide"] = smember_hide
|
||||
ImageMetaFunctions.SetMembers ["alpha"] = smember_alpha
|
||||
ImageMetaFunctions.SetMembers ["width"] = smember_width
|
||||
ImageMetaFunctions.SetMembers ["height"] = smember_height
|
||||
ImageMetaFunctions.SetMembers ["texture"] = smember_texture
|
||||
ImageMetaFunctions.SetMembers ["texcoord"] = smember_texcoord
|
||||
ImageMetaFunctions.SetMembers ["color"] = smember_color
|
||||
ImageMetaFunctions.SetMembers ["blackwhite"] = smember_desaturated
|
||||
|
||||
ImageMetaFunctions.__newindex = function (_table, _key, _value)
|
||||
local func = set_members_function_index [_key]
|
||||
local func = ImageMetaFunctions.SetMembers [_key]
|
||||
if (func) then
|
||||
return func (_table, _value)
|
||||
else
|
||||
@@ -280,6 +289,9 @@ function DF:NewImage (parent, texture, w, h, layer, coords, member, name)
|
||||
ImageObject.image:SetTexCoord (unpack (coords))
|
||||
end
|
||||
|
||||
ImageObject.HookList = {
|
||||
}
|
||||
|
||||
setmetatable (ImageObject, ImageMetaFunctions)
|
||||
|
||||
return ImageObject
|
||||
|
||||
+188
-159
@@ -17,12 +17,23 @@ local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
|
||||
|
||||
local cleanfunction = function() end
|
||||
local APISliderFunctions = false
|
||||
local SliderMetaFunctions = {}
|
||||
|
||||
do
|
||||
local metaPrototype = {
|
||||
WidgetType = "slider",
|
||||
SetHook = DF.SetHook,
|
||||
RunHooksForWidget = DF.RunHooksForWidget,
|
||||
}
|
||||
|
||||
_G [DF.GlobalWidgetControlNames ["slider"]] = _G [DF.GlobalWidgetControlNames ["slider"]] or metaPrototype
|
||||
end
|
||||
|
||||
local DFSliderMetaFunctions = _G [DF.GlobalWidgetControlNames ["slider"]]
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> metatables
|
||||
|
||||
SliderMetaFunctions.__call = function (_table, value)
|
||||
DFSliderMetaFunctions.__call = function (_table, value)
|
||||
if (not value) then
|
||||
if (_table.isSwitch) then
|
||||
|
||||
@@ -87,19 +98,18 @@ local SliderMetaFunctions = {}
|
||||
return _object()
|
||||
end
|
||||
|
||||
local get_members_function_index = {
|
||||
["tooltip"] = gmember_tooltip,
|
||||
["shown"] = gmember_shown,
|
||||
["width"] = gmember_width,
|
||||
["height"] = gmember_height,
|
||||
["locked"] = gmember_locked,
|
||||
["fractional"] = gmember_fractional,
|
||||
["value"] = gmember_value,
|
||||
}
|
||||
DFSliderMetaFunctions.GetMembers = DFSliderMetaFunctions.GetMembers or {}
|
||||
DFSliderMetaFunctions.GetMembers ["tooltip"] = gmember_tooltip
|
||||
DFSliderMetaFunctions.GetMembers ["shown"] = gmember_shown
|
||||
DFSliderMetaFunctions.GetMembers ["width"] = gmember_width
|
||||
DFSliderMetaFunctions.GetMembers ["height"] = gmember_height
|
||||
DFSliderMetaFunctions.GetMembers ["locked"] = gmember_locked
|
||||
DFSliderMetaFunctions.GetMembers ["fractional"] = gmember_fractional
|
||||
DFSliderMetaFunctions.GetMembers ["value"] = gmember_value
|
||||
|
||||
SliderMetaFunctions.__index = function (_table, _member_requested)
|
||||
DFSliderMetaFunctions.__index = function (_table, _member_requested)
|
||||
|
||||
local func = get_members_function_index [_member_requested]
|
||||
local func = DFSliderMetaFunctions.GetMembers [_member_requested]
|
||||
if (func) then
|
||||
return func (_table, _member_requested)
|
||||
end
|
||||
@@ -109,7 +119,7 @@ local SliderMetaFunctions = {}
|
||||
return fromMe
|
||||
end
|
||||
|
||||
return SliderMetaFunctions [_member_requested]
|
||||
return DFSliderMetaFunctions [_member_requested]
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -163,20 +173,19 @@ local SliderMetaFunctions = {}
|
||||
_object (_value)
|
||||
end
|
||||
|
||||
local set_members_function_index = {
|
||||
["tooltip"] = smember_tooltip,
|
||||
["show"] = smember_show,
|
||||
["hide"] = smember_hide,
|
||||
["backdrop"] = smember_backdrop,
|
||||
["width"] = smember_width,
|
||||
["height"] = smember_height,
|
||||
["locked"] = smember_locked,
|
||||
["fractional"] = smember_fractional,
|
||||
["value"] = smember_value,
|
||||
}
|
||||
DFSliderMetaFunctions.SetMembers = DFSliderMetaFunctions.SetMembers or {}
|
||||
DFSliderMetaFunctions.SetMembers ["tooltip"] = smember_tooltip
|
||||
DFSliderMetaFunctions.SetMembers ["show"] = smember_show
|
||||
DFSliderMetaFunctions.SetMembers ["hide"] = smember_hide
|
||||
DFSliderMetaFunctions.SetMembers ["backdrop"] = smember_backdrop
|
||||
DFSliderMetaFunctions.SetMembers ["width"] = smember_width
|
||||
DFSliderMetaFunctions.SetMembers ["height"] = smember_height
|
||||
DFSliderMetaFunctions.SetMembers ["locked"] = smember_locked
|
||||
DFSliderMetaFunctions.SetMembers ["fractional"] = smember_fractional
|
||||
DFSliderMetaFunctions.SetMembers ["value"] = smember_value
|
||||
|
||||
SliderMetaFunctions.__newindex = function (_table, _key, _value)
|
||||
local func = set_members_function_index [_key]
|
||||
DFSliderMetaFunctions.__newindex = function (_table, _key, _value)
|
||||
local func = DFSliderMetaFunctions.SetMembers [_key]
|
||||
if (func) then
|
||||
return func (_table, _value)
|
||||
else
|
||||
@@ -188,28 +197,28 @@ local SliderMetaFunctions = {}
|
||||
--> methods
|
||||
|
||||
--> show & hide
|
||||
function SliderMetaFunctions:IsShown()
|
||||
function DFSliderMetaFunctions:IsShown()
|
||||
return self.slider:IsShown()
|
||||
end
|
||||
function SliderMetaFunctions:Show()
|
||||
function DFSliderMetaFunctions:Show()
|
||||
return self.slider:Show()
|
||||
end
|
||||
function SliderMetaFunctions:Hide()
|
||||
function DFSliderMetaFunctions:Hide()
|
||||
return self.slider:Hide()
|
||||
end
|
||||
|
||||
--> fixed value
|
||||
function SliderMetaFunctions:SetFixedParameter (value)
|
||||
function DFSliderMetaFunctions:SetFixedParameter (value)
|
||||
_rawset (self, "FixedValue", value)
|
||||
end
|
||||
|
||||
--> set value
|
||||
function SliderMetaFunctions:SetValue (value)
|
||||
function DFSliderMetaFunctions:SetValue (value)
|
||||
return self (value)
|
||||
end
|
||||
|
||||
-- thumb size
|
||||
function SliderMetaFunctions:SetThumbSize (w, h)
|
||||
function DFSliderMetaFunctions:SetThumbSize (w, h)
|
||||
if (not w) then
|
||||
w = self.thumb:GetWidth()
|
||||
end
|
||||
@@ -221,7 +230,7 @@ local SliderMetaFunctions = {}
|
||||
|
||||
|
||||
-- setpoint
|
||||
function SliderMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
|
||||
function DFSliderMetaFunctions:SetPoint (v1, v2, v3, v4, v5)
|
||||
v1, v2, v3, v4, v5 = DF:CheckPoints (v1, v2, v3, v4, v5, self)
|
||||
if (not v1) then
|
||||
print ("Invalid parameter for SetPoint")
|
||||
@@ -231,7 +240,7 @@ local SliderMetaFunctions = {}
|
||||
end
|
||||
|
||||
-- sizes
|
||||
function SliderMetaFunctions:SetSize (w, h)
|
||||
function DFSliderMetaFunctions:SetSize (w, h)
|
||||
if (w) then
|
||||
self.slider:SetWidth (w)
|
||||
end
|
||||
@@ -241,22 +250,22 @@ local SliderMetaFunctions = {}
|
||||
end
|
||||
|
||||
-- tooltip
|
||||
function SliderMetaFunctions:SetTooltip (tooltip)
|
||||
function DFSliderMetaFunctions:SetTooltip (tooltip)
|
||||
if (tooltip) then
|
||||
return _rawset (self, "have_tooltip", tooltip)
|
||||
else
|
||||
return _rawset (self, "have_tooltip", nil)
|
||||
end
|
||||
end
|
||||
function SliderMetaFunctions:GetTooltip()
|
||||
function DFSliderMetaFunctions:GetTooltip()
|
||||
return _rawget (self, "have_tooltip")
|
||||
end
|
||||
|
||||
-- frame levels
|
||||
function SliderMetaFunctions:GetFrameLevel()
|
||||
function DFSliderMetaFunctions:GetFrameLevel()
|
||||
return self.slider:GetFrameLevel()
|
||||
end
|
||||
function SliderMetaFunctions:SetFrameLevel (level, frame)
|
||||
function DFSliderMetaFunctions:SetFrameLevel (level, frame)
|
||||
if (not frame) then
|
||||
return self.slider:SetFrameLevel (level)
|
||||
else
|
||||
@@ -266,10 +275,10 @@ local SliderMetaFunctions = {}
|
||||
end
|
||||
|
||||
-- frame stratas
|
||||
function SliderMetaFunctions:SetFrameStrata()
|
||||
function DFSliderMetaFunctions:SetFrameStrata()
|
||||
return self.slider:GetFrameStrata()
|
||||
end
|
||||
function SliderMetaFunctions:SetFrameStrata (strata)
|
||||
function DFSliderMetaFunctions:SetFrameStrata (strata)
|
||||
if (_type (strata) == "table") then
|
||||
self.slider:SetFrameStrata (strata:GetFrameStrata())
|
||||
else
|
||||
@@ -278,47 +287,53 @@ local SliderMetaFunctions = {}
|
||||
end
|
||||
|
||||
-- enabled
|
||||
function SliderMetaFunctions:IsEnabled()
|
||||
function DFSliderMetaFunctions:IsEnabled()
|
||||
return not _rawget (self, "lockdown")
|
||||
end
|
||||
function SliderMetaFunctions:Enable()
|
||||
|
||||
function DFSliderMetaFunctions:Enable()
|
||||
self.slider:Enable()
|
||||
if (not self.lock_texture) then
|
||||
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")
|
||||
if (not self.is_checkbox) then
|
||||
if (not self.lock_texture) then
|
||||
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
|
||||
self.lock_texture:Hide()
|
||||
end
|
||||
self.lock_texture:Hide()
|
||||
self.slider.amt:Show()
|
||||
self:SetAlpha (1)
|
||||
|
||||
if (self.is_checkbox) then
|
||||
self.checked_texture:Show()
|
||||
end
|
||||
return _rawset (self, "lockdown", false)
|
||||
end
|
||||
|
||||
function SliderMetaFunctions:Disable()
|
||||
function DFSliderMetaFunctions:Disable()
|
||||
|
||||
self.slider:Disable()
|
||||
self.slider.amt:Hide()
|
||||
self:SetAlpha (.4)
|
||||
|
||||
if (not self.lock_texture) then
|
||||
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")
|
||||
|
||||
if (not self.is_checkbox) then
|
||||
if (not self.lock_texture) then
|
||||
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
|
||||
self.lock_texture:Show()
|
||||
end
|
||||
self.lock_texture:Show()
|
||||
|
||||
if (self.is_checkbox) then
|
||||
self.checked_texture:Show()
|
||||
end
|
||||
|
||||
--print ("result 2:", self.checked_texture:IsShown(), self.checked_texture:GetAlpha(), self.checked_texture:GetSize())
|
||||
|
||||
return _rawset (self, "lockdown", true)
|
||||
end
|
||||
|
||||
--> hooks
|
||||
function SliderMetaFunctions:SetHook (hookType, func)
|
||||
if (func) then
|
||||
_rawset (self, hookType.."Hook", func)
|
||||
else
|
||||
_rawset (self, hookType.."Hook", nil)
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> scripts
|
||||
|
||||
@@ -330,11 +345,10 @@ local SliderMetaFunctions = {}
|
||||
|
||||
DetailsFrameworkSliderButtons1:ShowMe (slider)
|
||||
|
||||
if (slider.MyObject.OnEnterHook) then
|
||||
local interrupt = slider.MyObject.OnEnterHook (slider)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = slider.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnEnter", slider, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
slider.thumb:SetAlpha (1)
|
||||
@@ -363,11 +377,10 @@ local SliderMetaFunctions = {}
|
||||
|
||||
DetailsFrameworkSliderButtons1:PrepareToHide()
|
||||
|
||||
if (slider.MyObject.OnLeaveHook) then
|
||||
local interrupt = slider.MyObject.OnLeaveHook (slider)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = slider.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnLeave", slider, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
slider.thumb:SetAlpha (.7)
|
||||
@@ -419,6 +432,8 @@ local SliderMetaFunctions = {}
|
||||
|
||||
local button_plus = CreateFrame ("button", "DetailsFrameworkSliderButtonsPlusButton", f)
|
||||
local button_minor = CreateFrame ("button", "DetailsFrameworkSliderButtonsMinorButton", f)
|
||||
button_plus:SetFrameStrata (f:GetFrameStrata())
|
||||
button_minor:SetFrameStrata (f:GetFrameStrata())
|
||||
|
||||
button_plus:SetScript ("OnEnter", function (self)
|
||||
if (f.is_going_hide) then
|
||||
@@ -469,23 +484,23 @@ local SliderMetaFunctions = {}
|
||||
local plus_button_script = function()
|
||||
|
||||
local current = f.host.value
|
||||
local editbox = SliderMetaFunctions.editbox_typevalue
|
||||
local editbox = DFSliderMetaFunctions.editbox_typevalue
|
||||
|
||||
if (f.host.fine_tuning) then
|
||||
f.host:SetValue (current + f.host.fine_tuning)
|
||||
if (editbox and SliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
SliderMetaFunctions.editbox_typevalue:SetText (tostring (string.format ("%.2f", current + f.host.fine_tuning)))
|
||||
if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (string.format ("%.2f", current + f.host.fine_tuning)))
|
||||
end
|
||||
else
|
||||
if (f.host.useDecimals) then
|
||||
f.host:SetValue (current + 0.1)
|
||||
if (editbox and SliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
SliderMetaFunctions.editbox_typevalue:SetText (string.format ("%.2f", current + 0.1))
|
||||
if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetText (string.format ("%.2f", current + 0.1))
|
||||
end
|
||||
else
|
||||
f.host:SetValue (current + 1)
|
||||
if (editbox and SliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
SliderMetaFunctions.editbox_typevalue:SetText (tostring (math.floor (current + 1)))
|
||||
if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (math.floor (current + 1)))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -521,23 +536,23 @@ local SliderMetaFunctions = {}
|
||||
|
||||
local minor_button_script = function()
|
||||
local current = f.host.value
|
||||
local editbox = SliderMetaFunctions.editbox_typevalue
|
||||
local editbox = DFSliderMetaFunctions.editbox_typevalue
|
||||
|
||||
if (f.host.fine_tuning) then
|
||||
f.host:SetValue (current - f.host.fine_tuning)
|
||||
if (editbox and SliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
SliderMetaFunctions.editbox_typevalue:SetText (tostring (string.format ("%.2f", current - f.host.fine_tuning)))
|
||||
if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (string.format ("%.2f", current - f.host.fine_tuning)))
|
||||
end
|
||||
else
|
||||
if (f.host.useDecimals) then
|
||||
f.host:SetValue (current - 0.1)
|
||||
if (editbox and SliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
SliderMetaFunctions.editbox_typevalue:SetText (string.format ("%.2f", current - 0.1))
|
||||
if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetText (string.format ("%.2f", current - 0.1))
|
||||
end
|
||||
else
|
||||
f.host:SetValue (current - 1)
|
||||
if (editbox and SliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
SliderMetaFunctions.editbox_typevalue:SetText (tostring (math.floor (current - 1)))
|
||||
if (editbox and DFSliderMetaFunctions.editbox_typevalue:IsShown()) then
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (math.floor (current - 1)))
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -568,10 +583,10 @@ local SliderMetaFunctions = {}
|
||||
self:SetScript ("OnUpdate", on_update)
|
||||
end)
|
||||
|
||||
function SliderMetaFunctions:TypeValue()
|
||||
function DFSliderMetaFunctions:TypeValue()
|
||||
if (not self.isSwitch) then
|
||||
|
||||
if (not SliderMetaFunctions.editbox_typevalue) then
|
||||
if (not DFSliderMetaFunctions.editbox_typevalue) then
|
||||
|
||||
local editbox = CreateFrame ("EditBox", "DetailsFrameworkSliderEditBox", UIParent)
|
||||
|
||||
@@ -606,7 +621,7 @@ local SliderMetaFunctions = {}
|
||||
--print ()
|
||||
end)
|
||||
|
||||
SliderMetaFunctions.editbox_typevalue = editbox
|
||||
DFSliderMetaFunctions.editbox_typevalue = editbox
|
||||
end
|
||||
|
||||
local pvalue = self.previous_value [2]
|
||||
@@ -615,59 +630,67 @@ local SliderMetaFunctions = {}
|
||||
self.typing_value = true
|
||||
self.typing_value_started = pvalue
|
||||
|
||||
SliderMetaFunctions.editbox_typevalue:SetSize (self.width, self.height)
|
||||
SliderMetaFunctions.editbox_typevalue:SetPoint ("center", self.widget, "center")
|
||||
SliderMetaFunctions.editbox_typevalue:SetFocus()
|
||||
SliderMetaFunctions.editbox_typevalue:SetParent (self.widget)
|
||||
SliderMetaFunctions.editbox_typevalue:SetFrameLevel (self.widget:GetFrameLevel()+1)
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetSize (self.width, self.height)
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetPoint ("center", self.widget, "center")
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetFocus()
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetParent (self.widget)
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetFrameLevel (self.widget:GetFrameLevel()+1)
|
||||
|
||||
if (self.useDecimals) then
|
||||
SliderMetaFunctions.editbox_typevalue:SetText (tostring (string.format ("%.1f", self.value)))
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (string.format ("%.1f", self.value)))
|
||||
else
|
||||
SliderMetaFunctions.editbox_typevalue:SetText (tostring (math.floor (self.value)))
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetText (tostring (math.floor (self.value)))
|
||||
end
|
||||
|
||||
SliderMetaFunctions.editbox_typevalue:HighlightText()
|
||||
DFSliderMetaFunctions.editbox_typevalue:HighlightText()
|
||||
|
||||
SliderMetaFunctions.editbox_typevalue:Show()
|
||||
DFSliderMetaFunctions.editbox_typevalue:Show()
|
||||
end
|
||||
end
|
||||
|
||||
local OnMouseDown = function (slider, button)
|
||||
slider.MyObject.IsValueChanging = true
|
||||
|
||||
local capsule = slider.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseDown", slider, button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (button == "RightButton") then
|
||||
slider.MyObject:TypeValue()
|
||||
end
|
||||
end
|
||||
|
||||
local OnMouseUp = function (slider, button)
|
||||
--if (button == "RightButton") then
|
||||
-- if (slider.MyObject.typing_value) then
|
||||
-- slider.MyObject:SetValue (slider.MyObject.previous_value [2])
|
||||
-- end
|
||||
--end
|
||||
slider.MyObject.IsValueChanging = nil
|
||||
|
||||
local capsule = slider.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseUp", slider, button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnHide = function (slider)
|
||||
if (slider.MyObject.OnHideHook) then
|
||||
local interrupt = slider.MyObject.OnHideHook (slider)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = slider.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnHide", slider, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (slider.MyObject.typing_value) then
|
||||
SliderMetaFunctions.editbox_typevalue:ClearFocus()
|
||||
SliderMetaFunctions.editbox_typevalue:SetText ("")
|
||||
DFSliderMetaFunctions.editbox_typevalue:ClearFocus()
|
||||
DFSliderMetaFunctions.editbox_typevalue:SetText ("")
|
||||
slider.MyObject.typing_valu = false
|
||||
end
|
||||
end
|
||||
|
||||
local OnShow = function (slider)
|
||||
if (slider.MyObject.OnShowHook) then
|
||||
local interrupt = slider.MyObject.OnShowHook (slider)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = slider.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnShow", slider, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
@@ -691,13 +714,16 @@ local SliderMetaFunctions = {}
|
||||
table_insert (slider.MyObject.previous_value, 1, amt)
|
||||
table_remove (slider.MyObject.previous_value, 4)
|
||||
|
||||
if (slider.MyObject.OnValueChangeHook) then
|
||||
local interrupt = slider.MyObject.OnValueChangeHook (slider, slider.MyObject.FixedValue, amt)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = slider.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnValueChanged", slider, capsule.FixedValue, amt, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnValueChange", slider, capsule.FixedValue, amt, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (slider.MyObject.OnValueChanged) then
|
||||
slider.MyObject.OnValueChanged (slider, slider.MyObject.FixedValue, amt)
|
||||
end
|
||||
@@ -796,29 +822,23 @@ local switch_set_fixparameter = function (self, value)
|
||||
end
|
||||
|
||||
local switch_disable = function (self)
|
||||
if (not self.lock_texture) then
|
||||
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()
|
||||
if (not self.lock_texture) then
|
||||
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
|
||||
self.lock_texture:Show()
|
||||
end
|
||||
|
||||
self.lock_texture:Show()
|
||||
self:SetAlpha (.4)
|
||||
_rawset (self, "lockdown", true)
|
||||
end
|
||||
local switch_enable = function (self)
|
||||
if (not self.lock_texture) then
|
||||
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()
|
||||
@@ -826,16 +846,21 @@ local switch_enable = function (self)
|
||||
self.checked_texture:Hide()
|
||||
end
|
||||
else
|
||||
if (not self.lock_texture) then
|
||||
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
|
||||
self.lock_texture:Hide()
|
||||
self._text:Show()
|
||||
end
|
||||
|
||||
self.lock_texture:Hide()
|
||||
self:SetAlpha (1)
|
||||
return _rawset (self, "lockdown", false)
|
||||
end
|
||||
|
||||
local set_as_checkbok = function (self)
|
||||
local checked = self:CreateTexture (nil, "overlay")
|
||||
local checked = self:CreateTexture (self:GetName() .. "CheckTexture", "overlay")
|
||||
checked:SetTexture ([[Interface\Buttons\UI-CheckBox-Check]])
|
||||
checked:SetPoint ("center", self.button, "center", -1, -1)
|
||||
local size_pct = self:GetWidth()/32
|
||||
@@ -862,6 +887,7 @@ local set_as_checkbok = function (self)
|
||||
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)
|
||||
@@ -904,7 +930,7 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa
|
||||
slider.Disable = switch_disable
|
||||
slider.Enable = switch_enable
|
||||
slider.SetAsCheckBox = set_as_checkbok
|
||||
slider.SetTemplate = SliderMetaFunctions.SetTemplate
|
||||
slider.SetTemplate = DFSliderMetaFunctions.SetTemplate
|
||||
|
||||
if (member) then
|
||||
parent [member] = slider
|
||||
@@ -955,7 +981,7 @@ function DF:NewSwitch (parent, container, name, member, w, h, ltext, rtext, defa
|
||||
return slider, with_label
|
||||
end
|
||||
|
||||
function SliderMetaFunctions:SetTemplate (template)
|
||||
function DFSliderMetaFunctions:SetTemplate (template)
|
||||
|
||||
--slider e switch
|
||||
if (template.width) then
|
||||
@@ -1068,17 +1094,8 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de
|
||||
h = h or 19
|
||||
|
||||
--> default members:
|
||||
--> hooks
|
||||
SliderObject.OnEnterHook = nil
|
||||
SliderObject.OnLeaveHook = nil
|
||||
SliderObject.OnHideHook = nil
|
||||
SliderObject.OnShowHook = nil
|
||||
SliderObject.OnValueChangeHook = nil
|
||||
--> misc
|
||||
SliderObject.lockdown = false
|
||||
SliderObject.container = container
|
||||
SliderObject.have_tooltip = nil
|
||||
SliderObject.FixedValue = nil
|
||||
SliderObject.useDecimals = isDecemal or false
|
||||
|
||||
SliderObject.slider = CreateFrame ("slider", name, parent)
|
||||
@@ -1088,8 +1105,8 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de
|
||||
APISliderFunctions = true
|
||||
local idx = getmetatable (SliderObject.slider).__index
|
||||
for funcName, funcAddress in pairs (idx) do
|
||||
if (not SliderMetaFunctions [funcName]) then
|
||||
SliderMetaFunctions [funcName] = function (object, ...)
|
||||
if (not DFSliderMetaFunctions [funcName]) then
|
||||
DFSliderMetaFunctions [funcName] = function (object, ...)
|
||||
local x = loadstring ( "return _G['"..object.slider:GetName().."']:"..funcName.."(...)")
|
||||
return x (...)
|
||||
end
|
||||
@@ -1108,6 +1125,7 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de
|
||||
|
||||
SliderObject.slider:SetBackdrop ({edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", edgeSize = 8})
|
||||
SliderObject.slider:SetBackdropColor (0.9, 0.7, 0.7, 1.0)
|
||||
--SliderObject.slider:SetBackdropColor (0, 0, 0, 1)
|
||||
|
||||
SliderObject.thumb = SliderObject.slider:CreateTexture (nil, "artwork")
|
||||
SliderObject.thumb:SetTexture ("Interface\\Buttons\\UI-ScrollBar-Knob")
|
||||
@@ -1140,16 +1158,27 @@ function DF:NewSlider (parent, container, name, member, w, h, min, max, step, de
|
||||
SliderObject.previous_value = {defaultv or 0, 0, 0}
|
||||
|
||||
--> hooks
|
||||
SliderObject.slider:SetScript ("OnEnter", OnEnter)
|
||||
SliderObject.slider:SetScript ("OnLeave", OnLeave)
|
||||
SliderObject.slider:SetScript ("OnHide", OnHide)
|
||||
SliderObject.slider:SetScript ("OnShow", OnShow)
|
||||
SliderObject.slider:SetScript ("OnValueChanged", OnValueChanged)
|
||||
SliderObject.slider:SetScript ("OnMouseDown", OnMouseDown)
|
||||
SliderObject.slider:SetScript ("OnMouseUp", OnMouseUp)
|
||||
SliderObject.HookList = {
|
||||
OnEnter = {},
|
||||
OnLeave = {},
|
||||
OnHide = {},
|
||||
OnShow = {},
|
||||
OnMouseDown = {},
|
||||
OnMouseUp = {},
|
||||
|
||||
|
||||
_setmetatable (SliderObject, SliderMetaFunctions)
|
||||
OnValueChange = {},
|
||||
OnValueChanged = {},
|
||||
}
|
||||
|
||||
SliderObject.slider:SetScript ("OnEnter", OnEnter)
|
||||
SliderObject.slider:SetScript ("OnLeave", OnLeave)
|
||||
SliderObject.slider:SetScript ("OnHide", OnHide)
|
||||
SliderObject.slider:SetScript ("OnShow", OnShow)
|
||||
SliderObject.slider:SetScript ("OnValueChanged", OnValueChanged)
|
||||
SliderObject.slider:SetScript ("OnMouseDown", OnMouseDown)
|
||||
SliderObject.slider:SetScript ("OnMouseUp", OnMouseUp)
|
||||
|
||||
_setmetatable (SliderObject, DFSliderMetaFunctions)
|
||||
|
||||
if (with_label) then
|
||||
local label = DF:CreateLabel (SliderObject.slider, with_label, nil, nil, nil, "label", nil, "overlay")
|
||||
|
||||
+94
-99
@@ -13,9 +13,20 @@ local _type = type --> lua local
|
||||
local _math_floor = math.floor --> lua local
|
||||
|
||||
local cleanfunction = function() end
|
||||
local SplitBarMetaFunctions = {}
|
||||
local APISplitBarFunctions
|
||||
|
||||
do
|
||||
local metaPrototype = {
|
||||
WidgetType = "split_bar",
|
||||
SetHook = DF.SetHook,
|
||||
RunHooksForWidget = DF.RunHooksForWidget,
|
||||
}
|
||||
|
||||
_G [DF.GlobalWidgetControlNames ["split_bar"]] = _G [DF.GlobalWidgetControlNames ["split_bar"]] or metaPrototype
|
||||
end
|
||||
|
||||
local SplitBarMetaFunctions = _G [DF.GlobalWidgetControlNames ["split_bar"]]
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> metatables
|
||||
|
||||
@@ -122,30 +133,29 @@ local APISplitBarFunctions
|
||||
return _object.textleft:GetTextColor()
|
||||
end
|
||||
|
||||
local get_members_function_index = {
|
||||
["tooltip"] = gmember_tooltip,
|
||||
["shown"] = gmember_shown,
|
||||
["width"] = gmember_width,
|
||||
["height"] = gmember_height,
|
||||
["value"] = gmember_value,
|
||||
["righttext"] = gmember_rtext,
|
||||
["lefttext"] = gmember_ltext,
|
||||
["rightcolor"] = gmember_rcolor,
|
||||
["leftcolor"] = gmember_lcolor,
|
||||
["righticon"] = gmember_ricon,
|
||||
["lefticon"] = gmember_licon,
|
||||
["texture"] = gmember_texture,
|
||||
["fontsize"] = gmember_textsize,
|
||||
["fontface"] = gmember_textfont,
|
||||
["fontcolor"] = gmember_textcolor,
|
||||
["textsize"] = gmember_textsize, --alias
|
||||
["textfont"] = gmember_textfont, --alias
|
||||
["textcolor"] = gmember_textcolor --alias
|
||||
}
|
||||
SplitBarMetaFunctions.GetMembers = SplitBarMetaFunctions.GetMembers or {}
|
||||
SplitBarMetaFunctions.GetMembers ["tooltip"] = gmember_tooltip
|
||||
SplitBarMetaFunctions.GetMembers ["shown"] = gmember_shown
|
||||
SplitBarMetaFunctions.GetMembers ["width"] = gmember_width
|
||||
SplitBarMetaFunctions.GetMembers ["height"] = gmember_height
|
||||
SplitBarMetaFunctions.GetMembers ["value"] = gmember_value
|
||||
SplitBarMetaFunctions.GetMembers ["righttext"] = gmember_rtext
|
||||
SplitBarMetaFunctions.GetMembers ["lefttext"] = gmember_ltext
|
||||
SplitBarMetaFunctions.GetMembers ["rightcolor"] = gmember_rcolor
|
||||
SplitBarMetaFunctions.GetMembers ["leftcolor"] = gmember_lcolor
|
||||
SplitBarMetaFunctions.GetMembers ["righticon"] = gmember_ricon
|
||||
SplitBarMetaFunctions.GetMembers ["lefticon"] = gmember_licon
|
||||
SplitBarMetaFunctions.GetMembers ["texture"] = gmember_texture
|
||||
SplitBarMetaFunctions.GetMembers ["fontsize"] = gmember_textsize
|
||||
SplitBarMetaFunctions.GetMembers ["fontface"] = gmember_textfont
|
||||
SplitBarMetaFunctions.GetMembers ["fontcolor"] = gmember_textcolor
|
||||
SplitBarMetaFunctions.GetMembers ["textsize"] = gmember_textsize --alias
|
||||
SplitBarMetaFunctions.GetMembers ["textfont"] = gmember_textfont --alias
|
||||
SplitBarMetaFunctions.GetMembers ["textcolor"] = gmember_textcolor --alias
|
||||
|
||||
SplitBarMetaFunctions.__index = function (_table, _member_requested)
|
||||
|
||||
local func = get_members_function_index [_member_requested]
|
||||
local func = SplitBarMetaFunctions.GetMembers [_member_requested]
|
||||
if (func) then
|
||||
return func (_table, _member_requested)
|
||||
end
|
||||
@@ -274,29 +284,28 @@ local APISplitBarFunctions
|
||||
return _object.textright:SetTextColor (_value1, _value2, _value3, _value4)
|
||||
end
|
||||
|
||||
local set_members_function_index = {
|
||||
["tooltip"] = smember_tooltip,
|
||||
["shown"] = smember_shown,
|
||||
["width"] = smember_width,
|
||||
["height"] = smember_height,
|
||||
["value"] = smember_value,
|
||||
["righttext"] = smember_rtext,
|
||||
["lefttext"] = smember_ltext,
|
||||
["rightcolor"] = smember_rcolor,
|
||||
["leftcolor"] = smember_lcolor,
|
||||
["righticon"] = smember_ricon,
|
||||
["lefticon"] = smember_licon,
|
||||
["texture"] = smember_texture,
|
||||
["fontsize"] = smember_textsize,
|
||||
["fontface"] = smember_textfont,
|
||||
["fontcolor"] = smember_textcolor,
|
||||
["textsize"] = smember_textsize, --alias
|
||||
["textfont"] = smember_textfont, --alias
|
||||
["textcolor"] = smember_textcolor --alias
|
||||
}
|
||||
SplitBarMetaFunctions.SetMembers = SplitBarMetaFunctions.SetMembers or {}
|
||||
SplitBarMetaFunctions.SetMembers ["tooltip"] = smember_tooltip
|
||||
SplitBarMetaFunctions.SetMembers ["shown"] = smember_shown
|
||||
SplitBarMetaFunctions.SetMembers ["width"] = smember_width
|
||||
SplitBarMetaFunctions.SetMembers ["height"] = smember_height
|
||||
SplitBarMetaFunctions.SetMembers ["value"] = smember_value
|
||||
SplitBarMetaFunctions.SetMembers ["righttext"] = smember_rtext
|
||||
SplitBarMetaFunctions.SetMembers ["lefttext"] = smember_ltext
|
||||
SplitBarMetaFunctions.SetMembers ["rightcolor"] = smember_rcolor
|
||||
SplitBarMetaFunctions.SetMembers ["leftcolor"] = smember_lcolor
|
||||
SplitBarMetaFunctions.SetMembers ["righticon"] = smember_ricon
|
||||
SplitBarMetaFunctions.SetMembers ["lefticon"] = smember_licon
|
||||
SplitBarMetaFunctions.SetMembers ["texture"] = smember_texture
|
||||
SplitBarMetaFunctions.SetMembers ["fontsize"] = smember_textsize
|
||||
SplitBarMetaFunctions.SetMembers ["fontface"] = smember_textfont
|
||||
SplitBarMetaFunctions.SetMembers ["fontcolor"] = smember_textcolor
|
||||
SplitBarMetaFunctions.SetMembers ["textsize"] = smember_textsize --alias
|
||||
SplitBarMetaFunctions.SetMembers ["textfont"] = smember_textfont --alias
|
||||
SplitBarMetaFunctions.SetMembers ["textcolor"] = smember_textcolor --alias
|
||||
|
||||
SplitBarMetaFunctions.__newindex = function (_table, _key, _value)
|
||||
local func = set_members_function_index [_key]
|
||||
local func = SplitBarMetaFunctions.SetMembers [_key]
|
||||
if (func) then
|
||||
return func (_table, _value)
|
||||
else
|
||||
@@ -425,23 +434,13 @@ local APISplitBarFunctions
|
||||
end
|
||||
end
|
||||
|
||||
--> hooks
|
||||
function SplitBarMetaFunctions:SetHook (hookType, func)
|
||||
if (func) then
|
||||
_rawset (self, hookType.."Hook", func)
|
||||
else
|
||||
_rawset (self, hookType.."Hook", nil)
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> scripts
|
||||
local OnEnter = function (frame)
|
||||
if (frame.MyObject.OnEnterHook) then
|
||||
local interrupt = frame.MyObject.OnEnterHook (frame)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnEnter", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
frame.MyObject.div:SetPoint ("left", frame, "left", frame:GetValue() * (frame:GetWidth()/100) - 18, 0)
|
||||
@@ -454,11 +453,10 @@ local APISplitBarFunctions
|
||||
end
|
||||
|
||||
local OnLeave = function (frame)
|
||||
if (frame.MyObject.OnLeaveHook) then
|
||||
local interrupt = frame.MyObject.OnLeaveHook (frame)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnLeave", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.MyObject.have_tooltip) then
|
||||
@@ -467,29 +465,26 @@ local APISplitBarFunctions
|
||||
end
|
||||
|
||||
local OnHide = function (frame)
|
||||
if (frame.MyObject.OnHideHook) then
|
||||
local interrupt = frame.MyObject.OnHideHook (frame)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnHide", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnShow = function (frame)
|
||||
if (frame.MyObject.OnShowHook) then
|
||||
local interrupt = frame.MyObject.OnShowHook (frame)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnShow", frame, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnMouseDown = function (frame, button)
|
||||
if (frame.MyObject.OnMouseDownHook) then
|
||||
local interrupt = frame.MyObject.OnMouseDownHook (frame, button)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseDown", frame, button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (not frame.MyObject.container.isLocked and frame.MyObject.container:IsMovable()) then
|
||||
@@ -501,11 +496,10 @@ local APISplitBarFunctions
|
||||
end
|
||||
|
||||
local OnMouseUp = function (frame, button)
|
||||
if (frame.MyObject.OnMouseUpHook) then
|
||||
local interrupt = frame.MyObject.OnMouseUpHook (frame, button)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = frame.MyObject
|
||||
local kill = capsule:RunHooksForWidget ("OnMouseUp", frame, button, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (frame.MyObject.container.isMoving) then
|
||||
@@ -564,17 +558,8 @@ function DF:NewSplitBar (parent, container, name, member, w, h)
|
||||
end
|
||||
|
||||
--> default members:
|
||||
--> hooks
|
||||
SplitBarObject.OnEnterHook = nil
|
||||
SplitBarObject.OnLeaveHook = nil
|
||||
SplitBarObject.OnHideHook = nil
|
||||
SplitBarObject.OnShowHook = nil
|
||||
SplitBarObject.OnMouseDownHook = nil
|
||||
SplitBarObject.OnMouseUpHook = nil
|
||||
--> misc
|
||||
SplitBarObject.tooltip = nil
|
||||
SplitBarObject.locked = false
|
||||
SplitBarObject.have_tooltip = nil
|
||||
SplitBarObject.container = container
|
||||
|
||||
--> create widgets
|
||||
@@ -610,15 +595,25 @@ function DF:NewSplitBar (parent, container, name, member, w, h)
|
||||
|
||||
SplitBarObject.div = _G [name .. "_Spark"]
|
||||
|
||||
|
||||
|
||||
--> hooks
|
||||
SplitBarObject.statusbar:SetScript ("OnEnter", OnEnter)
|
||||
SplitBarObject.statusbar:SetScript ("OnLeave", OnLeave)
|
||||
SplitBarObject.statusbar:SetScript ("OnHide", OnHide)
|
||||
SplitBarObject.statusbar:SetScript ("OnShow", OnShow)
|
||||
SplitBarObject.statusbar:SetScript ("OnMouseDown", OnMouseDown)
|
||||
SplitBarObject.statusbar:SetScript ("OnMouseUp", OnMouseUp)
|
||||
SplitBarObject.statusbar:SetScript ("OnSizeChanged", OnSizeChanged)
|
||||
SplitBarObject.HookList = {
|
||||
OnEnter = {},
|
||||
OnLeave = {},
|
||||
OnHide = {},
|
||||
OnShow = {},
|
||||
OnMouseDown = {},
|
||||
OnMouseUp = {},
|
||||
OnSizeChanged = {},
|
||||
}
|
||||
|
||||
SplitBarObject.statusbar:SetScript ("OnEnter", OnEnter)
|
||||
SplitBarObject.statusbar:SetScript ("OnLeave", OnLeave)
|
||||
SplitBarObject.statusbar:SetScript ("OnHide", OnHide)
|
||||
SplitBarObject.statusbar:SetScript ("OnShow", OnShow)
|
||||
SplitBarObject.statusbar:SetScript ("OnMouseDown", OnMouseDown)
|
||||
SplitBarObject.statusbar:SetScript ("OnMouseUp", OnMouseUp)
|
||||
SplitBarObject.statusbar:SetScript ("OnSizeChanged", OnSizeChanged)
|
||||
|
||||
_setmetatable (SplitBarObject, SplitBarMetaFunctions)
|
||||
|
||||
|
||||
+418
-107
@@ -16,9 +16,19 @@ local _string_len = string.len --> lua local
|
||||
|
||||
local cleanfunction = function() end
|
||||
local APITextEntryFunctions = false
|
||||
local TextEntryMetaFunctions = {}
|
||||
|
||||
DF.TextEntryCounter = 1
|
||||
do
|
||||
local metaPrototype = {
|
||||
WidgetType = "textentry",
|
||||
SetHook = DF.SetHook,
|
||||
RunHooksForWidget = DF.RunHooksForWidget,
|
||||
}
|
||||
|
||||
_G [DF.GlobalWidgetControlNames ["textentry"]] = _G [DF.GlobalWidgetControlNames ["textentry"]] or metaPrototype
|
||||
end
|
||||
|
||||
local TextEntryMetaFunctions = _G [DF.GlobalWidgetControlNames ["textentry"]]
|
||||
DF.TextEntryCounter = DF.TextEntryCounter or 1
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> metatables
|
||||
@@ -51,17 +61,15 @@ DF.TextEntryCounter = 1
|
||||
return _object.editbox:GetText()
|
||||
end
|
||||
|
||||
local get_members_function_index = {
|
||||
["tooltip"] = gmember_tooltip,
|
||||
["shown"] = gmember_shown,
|
||||
["width"] = gmember_width,
|
||||
["height"] = gmember_height,
|
||||
["text"] = gmember_text,
|
||||
}
|
||||
TextEntryMetaFunctions.GetMembers = TextEntryMetaFunctions.GetMembers or {}
|
||||
TextEntryMetaFunctions.GetMembers ["tooltip"] = gmember_tooltip
|
||||
TextEntryMetaFunctions.GetMembers ["shown"] = gmember_shown
|
||||
TextEntryMetaFunctions.GetMembers ["width"] = gmember_width
|
||||
TextEntryMetaFunctions.GetMembers ["height"] = gmember_height
|
||||
TextEntryMetaFunctions.GetMembers ["text"] = gmember_text
|
||||
|
||||
TextEntryMetaFunctions.__index = function (_table, _member_requested)
|
||||
|
||||
local func = get_members_function_index [_member_requested]
|
||||
local func = TextEntryMetaFunctions.GetMembers [_member_requested]
|
||||
if (func) then
|
||||
return func (_table, _member_requested)
|
||||
end
|
||||
@@ -121,19 +129,18 @@ DF.TextEntryCounter = 1
|
||||
return _object.editbox:SetJustifyH (string.lower (_value))
|
||||
end
|
||||
|
||||
local set_members_function_index = {
|
||||
["tooltip"] = smember_tooltip,
|
||||
["show"] = smember_show,
|
||||
["hide"] = smember_hide,
|
||||
["width"] = smember_width,
|
||||
["height"] = smember_height,
|
||||
["text"] = smember_text,
|
||||
["multiline"] = smember_multiline,
|
||||
["align"] = smember_horizontalpos,
|
||||
}
|
||||
TextEntryMetaFunctions.SetMembers = TextEntryMetaFunctions.SetMembers or {}
|
||||
TextEntryMetaFunctions.SetMembers ["tooltip"] = smember_tooltip
|
||||
TextEntryMetaFunctions.SetMembers ["show"] = smember_show
|
||||
TextEntryMetaFunctions.SetMembers ["hide"] = smember_hide
|
||||
TextEntryMetaFunctions.SetMembers ["width"] = smember_width
|
||||
TextEntryMetaFunctions.SetMembers ["height"] = smember_height
|
||||
TextEntryMetaFunctions.SetMembers ["text"] = smember_text
|
||||
TextEntryMetaFunctions.SetMembers ["multiline"] = smember_multiline
|
||||
TextEntryMetaFunctions.SetMembers ["align"] = smember_horizontalpos
|
||||
|
||||
TextEntryMetaFunctions.__newindex = function (_table, _key, _value)
|
||||
local func = set_members_function_index [_key]
|
||||
local func = TextEntryMetaFunctions.SetMembers [_key]
|
||||
if (func) then
|
||||
return func (_table, _value)
|
||||
else
|
||||
@@ -143,6 +150,21 @@ DF.TextEntryCounter = 1
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> methods
|
||||
local cleanfunction = function()end
|
||||
function TextEntryMetaFunctions:SetEnterFunction (func, param1, param2)
|
||||
if (func) then
|
||||
_rawset (self, "func", func)
|
||||
else
|
||||
_rawset (self, "func", cleanfunction)
|
||||
end
|
||||
|
||||
if (param1 ~= nil) then
|
||||
_rawset (self, "param1", param1)
|
||||
end
|
||||
if (param2 ~= nil) then
|
||||
_rawset (self, "param2", param2)
|
||||
end
|
||||
end
|
||||
|
||||
--> set point
|
||||
function TextEntryMetaFunctions:SetPoint (MyAnchor, SnapTo, HisAnchor, x, y, Width)
|
||||
@@ -252,14 +274,6 @@ DF.TextEntryCounter = 1
|
||||
end
|
||||
|
||||
--> hooks
|
||||
function TextEntryMetaFunctions:SetHook (hookType, func)
|
||||
if (func) then
|
||||
_rawset (self, hookType.."Hook", func)
|
||||
else
|
||||
_rawset (self, hookType.."Hook", nil)
|
||||
end
|
||||
end
|
||||
|
||||
function TextEntryMetaFunctions:Enable()
|
||||
if (not self.editbox:IsEnabled()) then
|
||||
self.editbox:Enable()
|
||||
@@ -291,19 +305,19 @@ DF.TextEntryCounter = 1
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> scripts
|
||||
local OnEnter = function (textentry)
|
||||
--> scripts and hooks
|
||||
|
||||
if (textentry.MyObject.OnEnterHook) then
|
||||
local interrupt = textentry.MyObject.OnEnterHook (textentry)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local OnEnter = function (textentry)
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnEnter", textentry, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (textentry.MyObject.have_tooltip) then
|
||||
|
||||
if (capsule.have_tooltip) then
|
||||
GameCooltip2:Preset (2)
|
||||
GameCooltip2:AddLine (textentry.MyObject.have_tooltip)
|
||||
GameCooltip2:AddLine (capsule.have_tooltip)
|
||||
GameCooltip2:ShowCooltip (textentry, "tooltip")
|
||||
end
|
||||
|
||||
@@ -313,17 +327,16 @@ DF.TextEntryCounter = 1
|
||||
textentry.current_bordercolor = textentry.current_bordercolor or {textentry:GetBackdropBorderColor()}
|
||||
textentry:SetBackdropBorderColor (1, 1, 1, 1)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local OnLeave = function (textentry)
|
||||
if (textentry.MyObject.OnLeaveHook) then
|
||||
local interrupt = textentry.MyObject.OnLeaveHook (textentry)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
end
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnLeave", textentry, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (textentry.MyObject.have_tooltip) then
|
||||
GameCooltip2:ShowMe (false)
|
||||
end
|
||||
@@ -333,34 +346,32 @@ DF.TextEntryCounter = 1
|
||||
if (textentry:IsEnabled()) then
|
||||
textentry:SetBackdropBorderColor (unpack (textentry.current_bordercolor))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
local OnHide = function (textentry)
|
||||
if (textentry.MyObject.OnHideHook) then
|
||||
local interrupt = textentry.MyObject.OnHideHook (textentry)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnHide", textentry, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnShow = function (textentry)
|
||||
if (textentry.MyObject.OnShowHook) then
|
||||
local interrupt = textentry.MyObject.OnShowHook (textentry)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnShow", textentry, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnEnterPressed = function (textentry, byScript)
|
||||
local OnEnterPressed = function (textentry, byScript)
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
if (textentry.MyObject.OnEnterPressedHook) then
|
||||
local interrupt = textentry.MyObject.OnEnterPressedHook (textentry)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local kill = capsule:RunHooksForWidget ("OnEnterPressed", textentry, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
local texto = DF:trim (textentry:GetText())
|
||||
@@ -373,38 +384,47 @@ DF.TextEntryCounter = 1
|
||||
textentry:SetText ("")
|
||||
textentry.MyObject.currenttext = ""
|
||||
end
|
||||
textentry.focuslost = true --> perdeu_focus isso aqui pra quando estiver editando e clicar em outra caixa
|
||||
textentry:ClearFocus()
|
||||
|
||||
if (textentry.MyObject.tab_on_enter and textentry.MyObject.next) then
|
||||
textentry.MyObject.next:SetFocus()
|
||||
if (not capsule.NoClearFocusOnEnterPressed) then
|
||||
textentry.focuslost = true --> quando estiver editando e clicar em outra caixa
|
||||
textentry:ClearFocus()
|
||||
|
||||
if (textentry.MyObject.tab_on_enter and textentry.MyObject.next) then
|
||||
textentry.MyObject.next:SetFocus()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local OnEscapePressed = function (textentry)
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
if (textentry.MyObject.OnEscapePressedHook) then
|
||||
local interrupt = textentry.MyObject.OnEscapePressedHook (textentry)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
--textentry:SetText("")
|
||||
--textentry.MyObject.currenttext = ""
|
||||
local kill = capsule:RunHooksForWidget ("OnEscapePressed", textentry, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
textentry.focuslost = true
|
||||
textentry:ClearFocus()
|
||||
end
|
||||
|
||||
local OnSpacePressed = function (textentry)
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnSpacePressed", textentry, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnEditFocusLost = function (textentry)
|
||||
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
if (textentry:IsShown()) then
|
||||
|
||||
if (textentry.MyObject.OnEditFocusLostHook) then
|
||||
local interrupt = textentry.MyObject.OnEditFocusLostHook (textentry)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local kill = capsule:RunHooksForWidget ("OnEditFocusLost", textentry, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (not textentry.focuslost) then
|
||||
@@ -428,39 +448,42 @@ DF.TextEntryCounter = 1
|
||||
end
|
||||
|
||||
local OnEditFocusGained = function (textentry)
|
||||
if (textentry.MyObject.OnEditFocusGainedHook) then
|
||||
local interrupt = textentry.MyObject.OnEditFocusGainedHook (textentry)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnEditFocusGained", textentry, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
textentry.MyObject.label:SetTextColor (1, 1, 1, 1)
|
||||
end
|
||||
|
||||
local OnChar = function (textentry, text)
|
||||
if (textentry.MyObject.OnCharHook) then
|
||||
local interrupt = textentry.MyObject.OnCharHook (textentry, text)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local OnChar = function (textentry, char)
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnChar", textentry, char, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnTextChanged = function (textentry, byUser)
|
||||
if (textentry.MyObject.OnTextChangedHook) then
|
||||
local interrupt = textentry.MyObject.OnTextChangedHook (textentry, byUser)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnTextChanged", textentry, byUser, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local OnTabPressed = function (textentry)
|
||||
if (textentry.MyObject.OnTabPressedHook) then
|
||||
local interrupt = textentry.MyObject.OnTabPressedHook (textentry, byUser)
|
||||
if (interrupt) then
|
||||
return
|
||||
end
|
||||
|
||||
local capsule = textentry.MyObject
|
||||
|
||||
local kill = capsule:RunHooksForWidget ("OnTabPressed", textentry, byUser, capsule)
|
||||
if (kill) then
|
||||
return
|
||||
end
|
||||
|
||||
if (textentry.MyObject.next) then
|
||||
@@ -583,7 +606,7 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p
|
||||
w = space
|
||||
elseif (w and space) then
|
||||
if (DF.debug) then
|
||||
print ("warning: you are using width and space, try use only space for better results.")
|
||||
--print ("warning: you are using width and space, try use only space for better results.")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -617,6 +640,22 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p
|
||||
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.HookList = {
|
||||
OnEnter = {},
|
||||
OnLeave = {},
|
||||
OnHide = {},
|
||||
OnShow = {},
|
||||
OnEnterPressed = {},
|
||||
OnEscapePressed = {},
|
||||
OnSpacePressed = {},
|
||||
OnEditFocusLost = {},
|
||||
OnEditFocusGained = {},
|
||||
OnChar = {},
|
||||
OnTextChanged = {},
|
||||
OnTabPressed = {},
|
||||
}
|
||||
|
||||
TextEntryObject.editbox:SetScript ("OnEnter", OnEnter)
|
||||
TextEntryObject.editbox:SetScript ("OnLeave", OnLeave)
|
||||
TextEntryObject.editbox:SetScript ("OnHide", OnHide)
|
||||
@@ -624,6 +663,7 @@ function DF:NewTextEntry (parent, container, name, member, w, h, func, param1, p
|
||||
|
||||
TextEntryObject.editbox:SetScript ("OnEnterPressed", OnEnterPressed)
|
||||
TextEntryObject.editbox:SetScript ("OnEscapePressed", OnEscapePressed)
|
||||
TextEntryObject.editbox:SetScript ("OnSpacePressed", OnSpacePressed)
|
||||
TextEntryObject.editbox:SetScript ("OnEditFocusLost", OnEditFocusLost)
|
||||
TextEntryObject.editbox:SetScript ("OnEditFocusGained", OnEditFocusGained)
|
||||
TextEntryObject.editbox:SetScript ("OnChar", OnChar)
|
||||
@@ -653,8 +693,8 @@ end
|
||||
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)
|
||||
-- editbox:SetHook ("OnEditFocusGained", SpellEntryOnEditFocusGained)
|
||||
-- editbox:SetHook ("OnTextChanged", SpellEntryOnTextChanged)
|
||||
|
||||
return editbox
|
||||
end
|
||||
@@ -734,4 +774,275 @@ function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent)
|
||||
borderframe.editbox.borderframe = borderframe
|
||||
|
||||
return borderframe
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
------------------------------------------------------------------------------------
|
||||
--auto complete
|
||||
|
||||
-- block -------------------
|
||||
--code author Saiket from http://www.wowinterface.com/forums/showpost.php?p=245759&postcount=6
|
||||
--- @return StartPos, EndPos of highlight in this editbox.
|
||||
local function GetTextHighlight ( self )
|
||||
local Text, Cursor = self:GetText(), self:GetCursorPosition();
|
||||
self:Insert( "" ); -- Delete selected text
|
||||
local TextNew, CursorNew = self:GetText(), self:GetCursorPosition();
|
||||
-- Restore previous text
|
||||
self:SetText( Text );
|
||||
self:SetCursorPosition( Cursor );
|
||||
local Start, End = CursorNew, #Text - ( #TextNew - CursorNew );
|
||||
self:HighlightText( Start, End );
|
||||
return Start, End;
|
||||
end
|
||||
local StripColors;
|
||||
do
|
||||
local CursorPosition, CursorDelta;
|
||||
--- Callback for gsub to remove unescaped codes.
|
||||
local function StripCodeGsub ( Escapes, Code, End )
|
||||
if ( #Escapes % 2 == 0 ) then -- Doesn't escape Code
|
||||
if ( CursorPosition and CursorPosition >= End - 1 ) then
|
||||
CursorDelta = CursorDelta - #Code;
|
||||
end
|
||||
return Escapes;
|
||||
end
|
||||
end
|
||||
--- Removes a single escape sequence.
|
||||
local function StripCode ( Pattern, Text, OldCursor )
|
||||
CursorPosition, CursorDelta = OldCursor, 0;
|
||||
return Text:gsub( Pattern, StripCodeGsub ), OldCursor and CursorPosition + CursorDelta;
|
||||
end
|
||||
--- Strips Text of all color escape sequences.
|
||||
-- @param Cursor Optional cursor position to keep track of.
|
||||
-- @return Stripped text, and the updated cursor position if Cursor was given.
|
||||
function StripColors ( Text, Cursor )
|
||||
Text, Cursor = StripCode( "(|*)(|c%x%x%x%x%x%x%x%x)()", Text, Cursor );
|
||||
return StripCode( "(|*)(|r)()", Text, Cursor );
|
||||
end
|
||||
end
|
||||
|
||||
local COLOR_END = "|r";
|
||||
--- Wraps this editbox's selected text with the given color.
|
||||
local function ColorSelection ( self, ColorCode )
|
||||
local Start, End = GetTextHighlight( self );
|
||||
local Text, Cursor = self:GetText(), self:GetCursorPosition();
|
||||
if ( Start == End ) then -- Nothing selected
|
||||
--Start, End = Cursor, Cursor; -- Wrap around cursor
|
||||
return; -- Wrapping the cursor in a color code and hitting backspace crashes the client!
|
||||
end
|
||||
-- Find active color code at the end of the selection
|
||||
local ActiveColor;
|
||||
if ( End < #Text ) then -- There is text to color after the selection
|
||||
local ActiveEnd;
|
||||
local CodeEnd, _, Escapes, Color = 0;
|
||||
while ( true ) do
|
||||
_, CodeEnd, Escapes, Color = Text:find( "(|*)(|c%x%x%x%x%x%x%x%x)", CodeEnd + 1 );
|
||||
if ( not CodeEnd or CodeEnd > End ) then
|
||||
break;
|
||||
end
|
||||
if ( #Escapes % 2 == 0 ) then -- Doesn't escape Code
|
||||
ActiveColor, ActiveEnd = Color, CodeEnd;
|
||||
end
|
||||
end
|
||||
|
||||
if ( ActiveColor ) then
|
||||
-- Check if color gets terminated before selection ends
|
||||
CodeEnd = 0;
|
||||
while ( true ) do
|
||||
_, CodeEnd, Escapes = Text:find( "(|*)|r", CodeEnd + 1 );
|
||||
if ( not CodeEnd or CodeEnd > End ) then
|
||||
break;
|
||||
end
|
||||
if ( CodeEnd > ActiveEnd and #Escapes % 2 == 0 ) then -- Terminates ActiveColor
|
||||
ActiveColor = nil;
|
||||
break;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local Selection = Text:sub( Start + 1, End );
|
||||
-- Remove color codes from the selection
|
||||
local Replacement, CursorReplacement = StripColors( Selection, Cursor - Start );
|
||||
|
||||
self:SetText( ( "" ):join(
|
||||
Text:sub( 1, Start ),
|
||||
ColorCode, Replacement, COLOR_END,
|
||||
ActiveColor or "", Text:sub( End + 1 )
|
||||
) );
|
||||
|
||||
-- Restore cursor and highlight, adjusting for wrapper text
|
||||
Cursor = Start + CursorReplacement;
|
||||
if ( CursorReplacement > 0 ) then -- Cursor beyond start of color code
|
||||
Cursor = Cursor + #ColorCode;
|
||||
end
|
||||
if ( CursorReplacement >= #Replacement ) then -- Cursor beyond end of color
|
||||
Cursor = Cursor + #COLOR_END;
|
||||
end
|
||||
|
||||
self:SetCursorPosition( Cursor );
|
||||
-- Highlight selection and wrapper
|
||||
self:HighlightText( Start, #ColorCode + ( #Replacement - #Selection ) + #COLOR_END + End );
|
||||
end
|
||||
-- end of the block ---------------------
|
||||
|
||||
local get_last_word = function (self)
|
||||
self.lastword = ""
|
||||
local cursor_pos = self.editbox:GetCursorPosition()
|
||||
local text = self.editbox:GetText()
|
||||
for i = cursor_pos, 1, -1 do
|
||||
local character = text:sub (i, i)
|
||||
if (character:match ("%a")) then
|
||||
self.lastword = character .. self.lastword
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--On Text Changed
|
||||
local AutoComplete_OnTextChanged = function (editboxWidget, byUser, capsule)
|
||||
capsule = capsule or editboxWidget.MyObject
|
||||
|
||||
local chars_now = editboxWidget:GetText():len()
|
||||
if (not editboxWidget.ignore_textchange) then
|
||||
--> backspace
|
||||
if (chars_now == capsule.characters_count -1) then
|
||||
capsule.lastword = capsule.lastword:sub (1, capsule.lastword:len()-1)
|
||||
--> delete lots of text
|
||||
elseif (chars_now < capsule.characters_count) then
|
||||
--o auto complete selecionou outra palavra bem menor e caiu nesse filtro
|
||||
editboxWidget.end_selection = nil
|
||||
capsule:GetLastWord()
|
||||
end
|
||||
else
|
||||
editboxWidget.ignore_textchange = nil
|
||||
end
|
||||
capsule.characters_count = chars_now
|
||||
end
|
||||
|
||||
local AutoComplete_OnSpacePressed = function (editboxWidget, capsule)
|
||||
capsule = capsule or editboxWidget.MyObject
|
||||
|
||||
-- if (not gotMatch) then
|
||||
--editboxWidget.end_selection = nil
|
||||
-- end
|
||||
end
|
||||
|
||||
local AutoComplete_OnEscapePressed = function (editboxWidget)
|
||||
editboxWidget.end_selection = nil
|
||||
end
|
||||
|
||||
local AutoComplete_OnEnterPressed = function (editboxWidget)
|
||||
|
||||
local capsule = editboxWidget.MyObject
|
||||
if (editboxWidget.end_selection) then
|
||||
editboxWidget:SetCursorPosition (editboxWidget.end_selection)
|
||||
editboxWidget:HighlightText (0, 0)
|
||||
editboxWidget.end_selection = nil
|
||||
--editboxWidget:Insert (" ") --estava causando a adição de uma palavra a mais quando o próximo catactere for um espaço
|
||||
else
|
||||
if (editboxWidget:IsMultiLine()) then
|
||||
editboxWidget:Insert ("\n")
|
||||
--reseta a palavra se acabou de ganhar focus e apertou enter
|
||||
if (editboxWidget.focusGained) then
|
||||
capsule.lastword = ""
|
||||
editboxWidget.focusGained = nil
|
||||
end
|
||||
else
|
||||
editboxWidget:Insert ("")
|
||||
editboxWidget.focuslost = true
|
||||
editboxWidget:ClearFocus()
|
||||
end
|
||||
end
|
||||
capsule.lastword = ""
|
||||
|
||||
end
|
||||
|
||||
local AutoComplete_OnEditFocusGained = function (editboxWidget)
|
||||
local capsule = editboxWidget.MyObject
|
||||
capsule:GetLastWord()
|
||||
editboxWidget.end_selection = nil
|
||||
editboxWidget.focusGained = true
|
||||
capsule.characters_count = editboxWidget:GetText():len()
|
||||
end
|
||||
|
||||
local AutoComplete_OnChar = function (editboxWidget, char, capsule)
|
||||
if (char == "") then
|
||||
return
|
||||
end
|
||||
|
||||
capsule = capsule or editboxWidget.MyObject
|
||||
editboxWidget.end_selection = nil
|
||||
|
||||
if (editboxWidget.ignore_input) then
|
||||
return
|
||||
end
|
||||
|
||||
--reseta a palavra se acabou de ganhar focus e apertou espaço
|
||||
if (editboxWidget.focusGained and char == " ") then
|
||||
capsule.lastword = ""
|
||||
editboxWidget.focusGained = nil
|
||||
else
|
||||
editboxWidget.focusGained = nil
|
||||
end
|
||||
|
||||
if (char:match ("%a") or (char == " " and capsule.lastword ~= "")) then
|
||||
capsule.lastword = capsule.lastword .. char
|
||||
else
|
||||
capsule.lastword = ""
|
||||
end
|
||||
|
||||
editboxWidget.ignore_input = true
|
||||
if (capsule.lastword:len() >= 2) then
|
||||
|
||||
local wordList = capsule [capsule.poolName]
|
||||
if (not wordList) then
|
||||
if (DF.debug) then
|
||||
error ("Details! Framework: Invalid word list table.")
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
for i = 1, #wordList do
|
||||
local thisWord = wordList [i]
|
||||
if (thisWord and (thisWord:find ("^" .. capsule.lastword) or thisWord:lower():find ("^" .. capsule.lastword))) then
|
||||
local rest = thisWord:gsub (capsule.lastword, "")
|
||||
rest = rest:lower():gsub (capsule.lastword, "")
|
||||
local cursor_pos = editboxWidget:GetCursorPosition()
|
||||
editboxWidget:Insert (rest)
|
||||
editboxWidget:HighlightText (cursor_pos, cursor_pos + rest:len())
|
||||
editboxWidget:SetCursorPosition (cursor_pos)
|
||||
editboxWidget.end_selection = cursor_pos + rest:len()
|
||||
editboxWidget.ignore_textchange = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
editboxWidget.ignore_input = false
|
||||
end
|
||||
|
||||
function TextEntryMetaFunctions:SetAsAutoComplete (poolName)
|
||||
|
||||
self.lastword = ""
|
||||
self.characters_count = 0
|
||||
self.poolName = poolName
|
||||
self.GetLastWord = get_last_word --editbox:GetLastWord()
|
||||
self.NoClearFocusOnEnterPressed = true --avoid auto clear focus
|
||||
|
||||
self:SetHook ("OnEditFocusGained", AutoComplete_OnEditFocusGained)
|
||||
self.editbox:HookScript ("OnEscapePressed", AutoComplete_OnEscapePressed)
|
||||
|
||||
-- self:SetHook ("OnTextChanged", AutoComplete_OnTextChanged)
|
||||
self:SetHook ("OnEnterPressed", AutoComplete_OnEnterPressed)
|
||||
-- self:SetHook ("OnChar", AutoComplete_OnChar)
|
||||
-- self:SetHook ("OnSpacePressed", AutoComplete_OnSpacePressed)
|
||||
|
||||
self.editbox:SetScript ("OnTextChanged", AutoComplete_OnTextChanged)
|
||||
-- self.editbox:SetScript ("OnEnterPressed", AutoComplete_OnEnterPressed)
|
||||
self.editbox:SetScript ("OnChar", AutoComplete_OnChar)
|
||||
self.editbox:SetScript ("OnSpacePressed", AutoComplete_OnSpacePressed)
|
||||
|
||||
end
|
||||
|
||||
-- endp
|
||||
@@ -73,7 +73,7 @@
|
||||
-- Returns an array with the set of unit ids for the current group.
|
||||
--]]
|
||||
|
||||
local MAJOR, MINOR = "LibGroupInSpecT-1.1", tonumber (("$Revision: 78 $"):match ("(%d+)") or 0)
|
||||
local MAJOR, MINOR = "LibGroupInSpecT-1.1", tonumber (("$Revision: 79 $"):match ("(%d+)") or 0)
|
||||
|
||||
if not LibStub then error(MAJOR.." requires LibStub") end
|
||||
local lib = LibStub:NewLibrary (MAJOR, MINOR)
|
||||
@@ -570,7 +570,7 @@ function lib:BuildInfo (unit)
|
||||
|
||||
info.glyphs = wipe (info.glyphs or {})
|
||||
local glyph_info = self.static_cache.glyph_info
|
||||
for idx = 1,NUM_GLYPH_SLOTS do
|
||||
for idx = 1, (NUM_GLYPH_SLOTS or 0) do
|
||||
local enabled, glyph_type, _, spell_id, icon, glyph_id = GetGlyphSocketInfo (idx, nil, is_inspect, unit)
|
||||
if spell_id and not glyph_info[spell_id] then -- not already available in the cache
|
||||
glyph_info[spell_id] = {}
|
||||
@@ -695,7 +695,7 @@ function lib:SendLatestSpecData ()
|
||||
glyphstr = glyphstr..COMMS_DELIM..(glyph.idx or "")..COMMS_DELIM..(glyph.glyph_id or "")..COMMS_DELIM..(glyph.glyph_type or "")
|
||||
glyphCount = glyphCount + 1
|
||||
end
|
||||
for i=glyphCount,NUM_GLYPH_SLOTS do
|
||||
for i=glyphCount,(NUM_GLYPH_SLOTS or 0) do
|
||||
datastr = datastr..COMMS_DELIM..0
|
||||
glyphstr = glyphstr..COMMS_DELIM..COMMS_DELIM..COMMS_DELIM -- unused entry, but keep format sound
|
||||
end
|
||||
@@ -723,7 +723,7 @@ msg_idx.guid = msg_idx.fmt + 1
|
||||
msg_idx.global_spec_id = msg_idx.guid + 1
|
||||
msg_idx.talents = msg_idx.global_spec_id + 1
|
||||
msg_idx.glyphs = msg_idx.talents + MAX_TALENT_TIERS
|
||||
msg_idx.glyph_detail = msg_idx.glyphs + NUM_GLYPH_SLOTS
|
||||
msg_idx.glyph_detail = msg_idx.glyphs + (NUM_GLYPH_SLOTS or 0)
|
||||
|
||||
function lib:CHAT_MSG_ADDON (prefix, datastr, scope, sender)
|
||||
if prefix ~= COMMS_PREFIX or scope ~= self.commScope then return end
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
-- NickTag:SetNickname (name) -> set the player nick name, after set nicktag will broadcast the nick over addon guild channel.
|
||||
--
|
||||
|
||||
local major, minor = "NickTag-1.0", 7
|
||||
local major, minor = "NickTag-1.0", 8
|
||||
local NickTag, oldminor = LibStub:NewLibrary (major, minor)
|
||||
|
||||
if (not NickTag) then
|
||||
@@ -474,7 +474,9 @@ end
|
||||
if (NickTag.debug) then
|
||||
NickTag:Msg ("SendRevision() -> SENT")
|
||||
end
|
||||
NickTag:SendCommMessage ("NickTag", NickTag:Serialize (CONST_COMM_LOGONREVISION, battlegroup_serial, myPersona [CONST_INDEX_REVISION], UnitName ("player"), GetRealmName(), minor), "GUILD")
|
||||
if (IsInGuild()) then
|
||||
NickTag:SendCommMessage ("NickTag", NickTag:Serialize (CONST_COMM_LOGONREVISION, battlegroup_serial, myPersona [CONST_INDEX_REVISION], UnitName ("player"), GetRealmName(), minor), "GUILD")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -483,7 +485,9 @@ end
|
||||
if (NickTag.debug) then
|
||||
NickTag:Msg ("RequestPersona() -> requesting of " .. target)
|
||||
end
|
||||
NickTag:SendCommMessage ("NickTag", NickTag:Serialize (CONST_COMM_REQUESTPERSONA, 0, 0, UnitName ("player"), GetRealmName(), minor), "WHISPER", target)
|
||||
if (IsInGuild()) then
|
||||
NickTag:SendCommMessage ("NickTag", NickTag:Serialize (CONST_COMM_REQUESTPERSONA, 0, 0, UnitName ("player"), GetRealmName(), minor), "WHISPER", target)
|
||||
end
|
||||
end
|
||||
|
||||
--> this broadcast my persona to entire guild when i update my persona or send my persona to someone who doesn't have it or need to update.
|
||||
@@ -506,14 +510,18 @@ end
|
||||
|
||||
if (target) then
|
||||
--> was requested
|
||||
NickTag:SendCommMessage ("NickTag", NickTag:Serialize (CONST_COMM_FULLPERSONA, battlegroup_serial, NickTag:GetNicknameTable (battlegroup_serial), minor), "WHISPER", target)
|
||||
if (IsInGuild()) then
|
||||
NickTag:SendCommMessage ("NickTag", NickTag:Serialize (CONST_COMM_FULLPERSONA, battlegroup_serial, NickTag:GetNicknameTable (battlegroup_serial), minor), "WHISPER", target)
|
||||
end
|
||||
else
|
||||
--> updating my own persona
|
||||
NickTag.send_scheduled = false
|
||||
--> need to increase 1 revision
|
||||
NickTag:IncRevision()
|
||||
--> broadcast over guild channel
|
||||
NickTag:SendCommMessage ("NickTag", NickTag:Serialize (CONST_COMM_FULLPERSONA, battlegroup_serial, NickTag:GetNicknameTable (battlegroup_serial), minor), "GUILD")
|
||||
if (IsInGuild()) then
|
||||
NickTag:SendCommMessage ("NickTag", NickTag:Serialize (CONST_COMM_FULLPERSONA, battlegroup_serial, NickTag:GetNicknameTable (battlegroup_serial), minor), "GUILD")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -15,6 +15,5 @@
|
||||
<Script file="LibWindow-1.1\LibWindow-1.1.lua"/>
|
||||
<Include file="LibCompress\lib.xml"/>
|
||||
<Include file="LibItemUpgradeInfo-1.0\LibItemUpgradeInfo-1.0.xml"/>
|
||||
<Include file="LibGroupInSpecT-1.1\lib.xml"/>
|
||||
<Include file="DF\load.xml"/>
|
||||
</Ui>
|
||||
@@ -330,6 +330,9 @@
|
||||
end
|
||||
|
||||
--[[exported]] function _detalhes:GetSpellLink (spellid)
|
||||
if (_type (spellid) ~= "number") then
|
||||
return spellid
|
||||
end
|
||||
if (spellid == 1) then --melee
|
||||
return GetSpellLink (6603)
|
||||
elseif (spellid == 2) then --autoshot
|
||||
@@ -1426,6 +1429,9 @@
|
||||
end
|
||||
|
||||
local _, _, _, _, _, r, g, b = _detalhes:GetClass (t[1])
|
||||
if (first == 0) then
|
||||
first = 0.0000000001
|
||||
end
|
||||
GameCooltip:AddStatusBar (debuff_table.damage / first * 100, 1, r, g, b, 1, false, enemies_background)
|
||||
--_detalhes:AddTooltipBackgroundStatusbar()
|
||||
|
||||
@@ -2143,7 +2149,6 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
|
||||
qual_barra = qual_barra+1
|
||||
end
|
||||
end
|
||||
|
||||
conteudo[myPos]:AtualizaBarra (instancia, barras_container, qual_barra, myPos, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator)
|
||||
qual_barra = qual_barra+1
|
||||
else
|
||||
@@ -2169,6 +2174,7 @@ function atributo_damage:RefreshWindow (instancia, tabela_do_combate, forcar, ex
|
||||
else
|
||||
for i = instancia.barraS[1], instancia.barraS[2], 1 do
|
||||
if (conteudo[i]) then
|
||||
|
||||
conteudo[i]:AtualizaBarra (instancia, barras_container, qual_barra, i, total, sub_atributo, forcar, keyName, combat_time, percentage_type, use_animations, bars_show_data, bars_brackets, bars_separator)
|
||||
qual_barra = qual_barra+1
|
||||
end
|
||||
@@ -2282,10 +2288,10 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
|
||||
|
||||
esta_barra.minha_tabela = self --> grava uma referência desse objeto na barra
|
||||
self.minha_barra = esta_barra --> grava uma referência da barra no objeto
|
||||
|
||||
|
||||
esta_barra.colocacao = lugar --> salva na barra qual a colocação mostrada.
|
||||
self.colocacao = lugar --> salva no objeto qual a colocação mostrada
|
||||
|
||||
|
||||
local damage_total = self.total --> total de dano que este jogador deu
|
||||
local dps
|
||||
|
||||
@@ -2332,7 +2338,6 @@ function atributo_damage:AtualizaBarra (instancia, barras_container, qual_barra,
|
||||
-- >>>>>>>>>>>>>>> texto da direita
|
||||
|
||||
if (sub_atributo == 1) then --> mostrando damage done
|
||||
|
||||
dps = _math_floor (dps)
|
||||
local formated_damage = SelectedToKFunction (_, damage_total)
|
||||
local formated_dps = SelectedToKFunction (_, dps)
|
||||
@@ -2875,6 +2880,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
|
||||
else
|
||||
GameCooltip:AddLine (nome_magia..": ", FormatTooltipNumber (_, _math_floor (SkillTable [3])) .." (".._cstr("%.1f", SkillTable [2]/ActorDamage*100).."%)")
|
||||
end
|
||||
|
||||
GameCooltip:AddIcon (icone_magia, nil, nil, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B)
|
||||
_detalhes:AddTooltipBackgroundStatusbar()
|
||||
end
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
self.targets [nome] = self.targets [nome] or 0
|
||||
end
|
||||
|
||||
function habilidade_dano:Add (serial, nome, flag, amount, who_nome, resisted, blocked, absorbed, critical, glacing, token, multistrike, isoffhand)
|
||||
function habilidade_dano:Add (serial, nome, flag, amount, who_nome, resisted, blocked, absorbed, critical, glacing, token, isoffhand)
|
||||
|
||||
self.total = self.total + amount
|
||||
|
||||
|
||||
@@ -1878,6 +1878,8 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra)
|
||||
if (normal_hits > 0) then
|
||||
local normal_curado = esta_magia.n_curado
|
||||
local media_normal = normal_curado/normal_hits
|
||||
media_normal = max (media_normal, 0.000001)
|
||||
|
||||
local T = (meu_tempo*normal_curado)/esta_magia.total
|
||||
local P = media/media_normal*100
|
||||
T = P*T/100
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
return _newHealSpell
|
||||
end
|
||||
|
||||
function habilidade_cura:Add (serial, nome, flag, amount, who_nome, absorbed, critical, overhealing, is_shield, multistrike)
|
||||
function habilidade_cura:Add (serial, nome, flag, amount, who_nome, absorbed, critical, overhealing, is_shield)
|
||||
|
||||
amount = amount or 0
|
||||
self.total = self.total + amount
|
||||
|
||||
@@ -3249,7 +3249,11 @@ function _detalhes:envia_relatorio (linhas, custom)
|
||||
channel = to_who:gsub ((".*|"), "")
|
||||
|
||||
for i = 1, #linhas do
|
||||
_SendChatMessage (linhas[i], "CHANNEL", nil, _GetChannelName (channel))
|
||||
if (channel == "Trade") then
|
||||
channel = "Trade - City"
|
||||
end
|
||||
local channelName = GetChannelName (channel)
|
||||
_SendChatMessage (linhas[i], "CHANNEL", nil, channelName)
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
@@ -138,7 +138,7 @@ _detalhes.instance_defaults = {
|
||||
--blackwhiite icons
|
||||
desaturated_menu = false, --mode segment attribute report
|
||||
--icons on menu
|
||||
menu_icons = {true, true, true, true, true, false, space = -3, shadow = false}, --mode segment attribute report reset close
|
||||
menu_icons = {true, true, true, true, true, false, space = -2, shadow = false}, --mode segment attribute report reset close
|
||||
--menu icons size multiplicator factor
|
||||
menu_icons_size = 1.0, --mode segment attribute report
|
||||
--auto hide menu buttons
|
||||
|
||||
+3
-1
@@ -10,7 +10,9 @@ local floor = floor
|
||||
local GetNumGroupMembers = GetNumGroupMembers
|
||||
|
||||
local ItemUpgradeInfo = LibStub ("LibItemUpgradeInfo-1.0")
|
||||
local LibGroupInSpecT = LibStub ("LibGroupInSpecT-1.1")
|
||||
|
||||
--LibGroupInSpecT-1.1 is giving errors on Legion Beta
|
||||
--local LibGroupInSpecT = LibStub ("LibGroupInSpecT-1.1")
|
||||
|
||||
function _detalhes:UpdateGears()
|
||||
|
||||
|
||||
+92
-48
@@ -146,13 +146,13 @@
|
||||
--> DAMAGE serach key: ~damage |
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function parser:swing (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand, multistrike)
|
||||
return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 1, "Corpo-a-Corpo", 00000001, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand, multistrike) --> localize-me
|
||||
function parser:swing (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
|
||||
return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 1, "Corpo-a-Corpo", 00000001, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) --> localize-me
|
||||
--spellid, spellname, spelltype
|
||||
end
|
||||
|
||||
function parser:range (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand, multistrike)
|
||||
return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 2, "Tiro-Automático", 00000001, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand, multistrike) --> localize-me
|
||||
function parser:range (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
|
||||
return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 2, "Tiro-Automático", 00000001, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand) --> localize-me
|
||||
--spellid, spellname, spelltype
|
||||
end
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
|
||||
-- /run local f=CreateFrame("frame");f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");f:SetScript("OnEvent",function(self, ...) local a = select(3, ...);print (a);if (a=="SPELL_CAST_SUCCESS")then print (...) end end)
|
||||
|
||||
function parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand, multistrike)
|
||||
function parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--> early checks and fixes
|
||||
@@ -208,7 +208,7 @@
|
||||
|
||||
--> spirit link toten
|
||||
if (spellid == 98021) then
|
||||
return parser:SLT_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand, multistrike)
|
||||
return parser:SLT_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
|
||||
end
|
||||
|
||||
if (soul_capacitor [who_serial]) then
|
||||
@@ -539,6 +539,10 @@
|
||||
end
|
||||
|
||||
--> faz a adição do friendly fire
|
||||
--if (not amount) then
|
||||
--print ("No AMOUNT")
|
||||
--print (token, who_name, who_flags, alvo_name, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
|
||||
--end
|
||||
este_jogador.friendlyfire_total = este_jogador.friendlyfire_total + amount
|
||||
|
||||
local friend = este_jogador.friendlyfire [alvo_name] or este_jogador:CreateFFTable (alvo_name)
|
||||
@@ -611,10 +615,10 @@
|
||||
end
|
||||
end
|
||||
|
||||
return spell_damage_func (spell, alvo_serial, alvo_name, alvo_flags, amount, who_name, resisted, blocked, absorbed, critical, glacing, token, multistrike, isoffhand)
|
||||
return spell_damage_func (spell, alvo_serial, alvo_name, alvo_flags, amount, who_name, resisted, blocked, absorbed, critical, glacing, token, isoffhand)
|
||||
end
|
||||
|
||||
function parser:SLT_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand, multistrike)
|
||||
function parser:SLT_damage (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overkill, school, resisted, blocked, absorbed, critical, glacing, crushing, isoffhand)
|
||||
|
||||
--> damager
|
||||
local este_jogador, meu_dono = damage_cache [who_serial] or damage_cache_pets [who_serial] or damage_cache [who_name], damage_cache_petsOwners [who_serial]
|
||||
@@ -721,16 +725,16 @@
|
||||
end
|
||||
|
||||
--function parser:swingmissed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, missType, isOffHand, amountMissed)
|
||||
function parser:swingmissed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, missType, isOffHand, multistrike, amountMissed) --, isOffHand, multistrike, amountMissed, arg1
|
||||
return parser:missed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 1, "Corpo-a-Corpo", 00000001, missType, isOffHand, multistrike, amountMissed) --, isOffHand, multistrike, amountMissed, arg1
|
||||
function parser:swingmissed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, missType, isOffHand, amountMissed) --, isOffHand, amountMissed, arg1
|
||||
return parser:missed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 1, "Corpo-a-Corpo", 00000001, missType, isOffHand, amountMissed) --, isOffHand, amountMissed, arg1
|
||||
end
|
||||
|
||||
function parser:rangemissed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, missType, isOffHand, multistrike, amountMissed) --, isOffHand, multistrike, amountMissed, arg1
|
||||
return parser:missed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 2, "Tiro-Automático", 00000001, missType, isOffHand, multistrike, amountMissed) --, isOffHand, multistrike, amountMissed, arg1
|
||||
function parser:rangemissed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, missType, isOffHand, amountMissed) --, isOffHand, amountMissed, arg1
|
||||
return parser:missed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, 2, "Tiro-Automático", 00000001, missType, isOffHand, amountMissed) --, isOffHand, amountMissed, arg1
|
||||
end
|
||||
|
||||
-- ~miss
|
||||
function parser:missed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, missType, isOffHand, multistrike, amountMissed, arg1)
|
||||
function parser:missed (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, missType, isOffHand, amountMissed, arg1)
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--> early checks and fixes
|
||||
@@ -748,7 +752,7 @@
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--> get actors
|
||||
--print ("MISS", "|", missType, "|", isOffHand, "|", multistrike, "|", amountMissed, "|", arg1)
|
||||
--print ("MISS", "|", missType, "|", isOffHand, "|", amountMissed, "|", arg1)
|
||||
|
||||
--> 'misser'
|
||||
local este_jogador = damage_cache [who_serial]
|
||||
@@ -813,13 +817,13 @@
|
||||
if (missType == "ABSORB") then
|
||||
|
||||
if (token == "SWING_MISSED") then
|
||||
return parser:swing ("SWING_DAMAGE", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, amountMissed, -1, 1, nil, nil, nil, false, false, false, false, multistrike)
|
||||
return parser:swing ("SWING_DAMAGE", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, amountMissed, -1, 1, nil, nil, nil, false, false, false, false)
|
||||
|
||||
elseif (token == "RANGE_MISSED") then
|
||||
return parser:range ("RANGE_DAMAGE", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amountMissed, -1, 1, nil, nil, nil, false, false, false, false, multistrike)
|
||||
return parser:range ("RANGE_DAMAGE", time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amountMissed, -1, 1, nil, nil, nil, false, false, false, false)
|
||||
|
||||
else
|
||||
return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amountMissed, -1, 1, nil, nil, nil, false, false, false, false, multistrike)
|
||||
return parser:spell_dmg (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amountMissed, -1, 1, nil, nil, nil, false, false, false, false)
|
||||
|
||||
end
|
||||
|
||||
@@ -955,7 +959,7 @@
|
||||
|
||||
end
|
||||
|
||||
function parser:heal (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overhealing, absorbed, critical, multistrike, is_shield)
|
||||
function parser:heal (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, overhealing, absorbed, critical, is_shield)
|
||||
|
||||
------------------------------------------------------------------------------------------------
|
||||
--> early checks and fixes
|
||||
@@ -985,7 +989,7 @@
|
||||
|
||||
--> spirit link toten
|
||||
if (spellid == 98021) then
|
||||
return parser:SLT_healing (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overhealing, absorbed, critical, multistrike, is_shield)
|
||||
return parser:SLT_healing (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overhealing, absorbed, critical, is_shield)
|
||||
end
|
||||
|
||||
--[[statistics]]-- _detalhes.statistics.heal_calls = _detalhes.statistics.heal_calls + 1
|
||||
@@ -1163,14 +1167,14 @@
|
||||
|
||||
if (is_shield) then
|
||||
--return spell:Add (alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, 0, nil, overhealing, true)
|
||||
return spell_heal_func (spell, alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, 0, nil, overhealing, true, multistrike)
|
||||
return spell_heal_func (spell, alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, 0, nil, overhealing, true)
|
||||
else
|
||||
--return spell:Add (alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, absorbed, critical, overhealing)
|
||||
return spell_heal_func (spell, alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, absorbed, critical, overhealing, nil, multistrike)
|
||||
return spell_heal_func (spell, alvo_serial, alvo_name, alvo_flags, cura_efetiva, who_name, absorbed, critical, overhealing)
|
||||
end
|
||||
end
|
||||
|
||||
function parser:SLT_healing (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overhealing, absorbed, critical, multistrike, is_shield)
|
||||
function parser:SLT_healing (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, spellid, spellname, spelltype, amount, overhealing, absorbed, critical, is_shield)
|
||||
|
||||
--> get actors
|
||||
local este_jogador, meu_dono = healing_cache [who_name]
|
||||
@@ -1224,7 +1228,7 @@
|
||||
spell.neutral = true
|
||||
end
|
||||
|
||||
return spell_heal_func (spell, alvo_serial, alvo_name, alvo_flags, absorbed + amount - overhealing, who_name, absorbed, critical, overhealing, nil, multistrike)
|
||||
return spell_heal_func (spell, alvo_serial, alvo_name, alvo_flags, absorbed + amount - overhealing, who_name, absorbed, critical, overhealing, nil)
|
||||
end
|
||||
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
@@ -1883,6 +1887,26 @@
|
||||
--> ENERGY serach key: ~energy |
|
||||
-----------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
--SPELL_POWER_MANA = 0;
|
||||
--SPELL_POWER_RAGE = 1;
|
||||
SPELL_POWER_FOCUS = 2;
|
||||
--SPELL_POWER_ENERGY = 3;
|
||||
--SPELL_POWER_COMBO_POINTS = 4;
|
||||
--SPELL_POWER_RUNES = 5;
|
||||
--SPELL_POWER_RUNIC_POWER = 6;
|
||||
--SPELL_POWER_SOUL_SHARDS = 7;
|
||||
--SPELL_POWER_LUNAR_POWER = 8;
|
||||
--SPELL_POWER_HOLY_POWER = 9;
|
||||
SPELL_POWER_ALTERNATE_POWER = 10;
|
||||
--SPELL_POWER_MAELSTROM = 11;
|
||||
--SPELL_POWER_CHI = 12;
|
||||
--SPELL_POWER_INSANITY = 13;
|
||||
SPELL_POWER_OBSOLETE = 14;
|
||||
SPELL_POWER_OBSOLETE2 = 15;
|
||||
--SPELL_POWER_ARCANE_CHARGES = 16;
|
||||
--SPELL_POWER_FURY = 17;
|
||||
--SPELL_POWER_PAIN = 18;
|
||||
|
||||
local energy_types = {
|
||||
[SPELL_POWER_MANA] = true,
|
||||
[SPELL_POWER_RAGE] = true,
|
||||
@@ -1891,45 +1915,60 @@
|
||||
}
|
||||
|
||||
local resource_types = {
|
||||
[SPELL_POWER_DEMONIC_FURY] = true, --warlock demonology
|
||||
[SPELL_POWER_BURNING_EMBERS] = true, --warlock destruction
|
||||
[SPELL_POWER_SHADOW_ORBS] = true, --shadow priest
|
||||
[SPELL_POWER_INSANITY] = true, --shadow priest
|
||||
[SPELL_POWER_CHI] = true, --monk
|
||||
[SPELL_POWER_HOLY_POWER] = true, --paladins
|
||||
[SPELL_POWER_ECLIPSE] = true, --balance druids
|
||||
[SPELL_POWER_LUNAR_POWER] = true, --balance druids
|
||||
[SPELL_POWER_SOUL_SHARDS] = true, --warlock affliction
|
||||
[4] = true, --combo points
|
||||
[SPELL_POWER_COMBO_POINTS] = true, --combo points
|
||||
[SPELL_POWER_MAELSTROM] = true, --shamans
|
||||
[SPELL_POWER_PAIN] = true, --demonhuinter
|
||||
[SPELL_POWER_RUNES] = true, --dk
|
||||
[SPELL_POWER_ARCANE_CHARGES] = true, --mage
|
||||
[SPELL_POWER_FURY] = true, --warrior
|
||||
}
|
||||
|
||||
local resource_power_type = {
|
||||
[4] = SPELL_POWER_ENERGY, --combo points
|
||||
[SPELL_POWER_SOUL_SHARDS] = SPELL_POWER_MANA,
|
||||
[SPELL_POWER_ECLIPSE] = SPELL_POWER_MANA,
|
||||
[SPELL_POWER_HOLY_POWER] = SPELL_POWER_MANA,
|
||||
[SPELL_POWER_SHADOW_ORBS] = SPELL_POWER_MANA,
|
||||
[SPELL_POWER_DEMONIC_FURY] = SPELL_POWER_MANA,
|
||||
[SPELL_POWER_BURNING_EMBERS] = SPELL_POWER_MANA,
|
||||
[SPELL_POWER_COMBO_POINTS] = SPELL_POWER_ENERGY, --combo points
|
||||
[SPELL_POWER_SOUL_SHARDS] = SPELL_POWER_MANA, --warlock
|
||||
[SPELL_POWER_LUNAR_POWER] = SPELL_POWER_MANA, --druid
|
||||
[SPELL_POWER_HOLY_POWER] = SPELL_POWER_MANA, --paladin
|
||||
[SPELL_POWER_INSANITY] = SPELL_POWER_MANA, --shadowpriest
|
||||
[SPELL_POWER_MAELSTROM] = SPELL_POWER_MANA, --shaman
|
||||
[SPELL_POWER_CHI] = SPELL_POWER_MANA, --monk
|
||||
[SPELL_POWER_PAIN] = SPELL_POWER_ENERGY, --demonhuinter
|
||||
[SPELL_POWER_RUNES] = SPELL_POWER_RUNIC_POWER, --dk
|
||||
[SPELL_POWER_ARCANE_CHARGES] = SPELL_POWER_MANA, --mage
|
||||
[SPELL_POWER_FURY] = SPELL_POWER_RAGE, --warrioor
|
||||
}
|
||||
|
||||
_detalhes.resource_strings = {
|
||||
[4] = "Combo Point",
|
||||
[SPELL_POWER_COMBO_POINTS] = "Combo Point",
|
||||
[SPELL_POWER_SOUL_SHARDS] = "Soul Shard",
|
||||
[SPELL_POWER_ECLIPSE] = "Eclipse",
|
||||
[SPELL_POWER_LUNAR_POWER] = "Lunar Power",
|
||||
[SPELL_POWER_HOLY_POWER] = "Holy Power",
|
||||
[SPELL_POWER_SHADOW_ORBS] = "Shadow Orb",
|
||||
[SPELL_POWER_DEMONIC_FURY] = "Demonic Fury",
|
||||
[SPELL_POWER_BURNING_EMBERS] = "Burning Embers",
|
||||
[SPELL_POWER_INSANITY] = "Insanity",
|
||||
[SPELL_POWER_MAELSTROM] = "Maelstrom",
|
||||
[SPELL_POWER_CHI] = "Chi",
|
||||
[SPELL_POWER_PAIN] = "Pain",
|
||||
[SPELL_POWER_RUNES] = "Runes",
|
||||
[SPELL_POWER_ARCANE_CHARGES] = "Arcane Charge",
|
||||
[SPELL_POWER_FURY] = "Rage",
|
||||
}
|
||||
|
||||
_detalhes.resource_icons = {
|
||||
[4] = {file = [[Interface\CHARACTERFRAME\ComboPoint]], coords = {1/32, 18/32, 1/16, 14/16}},
|
||||
[SPELL_POWER_SOUL_SHARDS] = {file = [[Interface\PLAYERFRAME\UI-WARLOCKSHARD]], coords = {2/64, 2/64, 17/128, 16/128}},
|
||||
[SPELL_POWER_ECLIPSE] = {file = [[Interface\PLAYERFRAME\DruidEclipse]], coords = {117/256, 138/256, 72/128, 113/128}},
|
||||
[SPELL_POWER_COMBO_POINTS] = {file = [[Interface\PLAYERFRAME\ClassOverlayComboPoints]], coords = {58/128, 74/128, 25/64, 39/64}},
|
||||
[SPELL_POWER_SOUL_SHARDS] = {file = [[Interface\PLAYERFRAME\UI-WARLOCKSHARD]], coords = {3/64, 17/64, 2/128, 16/128}},
|
||||
[SPELL_POWER_LUNAR_POWER] = {file = [[Interface\PLAYERFRAME\DruidEclipse]], coords = {117/256, 140/256, 83/128, 115/128}},
|
||||
[SPELL_POWER_HOLY_POWER] = {file = [[Interface\PLAYERFRAME\PALADINPOWERTEXTURES]], coords = {75/256, 94/256, 87/128, 100/128}},
|
||||
[SPELL_POWER_SHADOW_ORBS] = {file = [[Interface\PLAYERFRAME\Priest-ShadowUI]], coords = {119/256, 150/256, 61/128, 94/128}},
|
||||
[SPELL_POWER_DEMONIC_FURY] = {file = [[Interface\PLAYERFRAME\Warlock-DemonologyUI]], coords = {76/256, 109/256, 90/256, 104/256}},
|
||||
[SPELL_POWER_BURNING_EMBERS] = {file = [[Interface\PLAYERFRAME\Warlock-DestructionUI]], coords = {3/256, 33/256, 23/64, 52/64}}
|
||||
}
|
||||
[SPELL_POWER_INSANITY] = {file = [[Interface\PLAYERFRAME\Priest-ShadowUI]], coords = {119/256, 150/256, 61/128, 94/128}},
|
||||
[SPELL_POWER_MAELSTROM] = {file = [[Interface\PLAYERFRAME\MonkNoPower]], coords = {0, 1, 0, 1}},
|
||||
[SPELL_POWER_CHI] = {file = [[Interface\PLAYERFRAME\MonkLightPower]], coords = {0, 1, 0, 1}},
|
||||
[SPELL_POWER_PAIN] = {file = [[Interface\PLAYERFRAME\Deathknight-Energize-Blood]], coords = {0, 1, 0, 1}},
|
||||
[SPELL_POWER_RUNES] = {file = [[Interface\PLAYERFRAME\UI-PlayerFrame-Deathknight-SingleRune]], coords = {0, 1, 0, 1}},
|
||||
[SPELL_POWER_ARCANE_CHARGES] = {file = [[Interface\PLAYERFRAME\MageArcaneCharges]], coords = {68/256, 90/256, 68/128, 91/128}},
|
||||
[SPELL_POWER_FURY] = {file = [[Interface\PLAYERFRAME\UI-PlayerFrame-Deathknight-Blood-On]], coords = {0, 1, 0, 1}},
|
||||
}
|
||||
|
||||
function parser:energize (token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, amount, powertype, p6, p7)
|
||||
|
||||
@@ -3507,7 +3546,8 @@
|
||||
_detalhes:Msg ("(debug) found a timer.")
|
||||
end
|
||||
|
||||
if (C_Scenario.IsChallengeMode() and _detalhes.overall_clear_newchallenge) then
|
||||
--if (C_Scenario.IsChallengeMode() and _detalhes.overall_clear_newchallenge) then
|
||||
if (_detalhes.overall_clear_newchallenge) then --C_Scenario.IsChallengeMode() and parece que não existe mais
|
||||
_detalhes.historico:resetar_overall()
|
||||
if (_detalhes.debug) then
|
||||
_detalhes:Msg ("(debug) timer is a challenge mode start.")
|
||||
@@ -3713,6 +3753,10 @@
|
||||
function _detalhes:OnParserEvent (evento, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, ...)
|
||||
local funcao = token_list [token]
|
||||
|
||||
-- if (token == "COMBATANT_INFO") then
|
||||
-- print ("COMBATANT_INFO", evento, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2)
|
||||
-- end
|
||||
|
||||
-- if (who_name == "Ditador") then
|
||||
-- print (token, alvo_name, ...)
|
||||
-- end
|
||||
|
||||
+5
-1
@@ -277,7 +277,11 @@
|
||||
local Frame = CreateFrame ("Frame", FrameName, UIParent)
|
||||
Frame:RegisterEvent ("ADDON_LOADED")
|
||||
Frame:RegisterEvent ("PLAYER_LOGOUT")
|
||||
Frame:SetScript ("OnEvent", function(event, ...) return NewPlugin:OnEvent (event, ...) end)
|
||||
Frame:SetScript ("OnEvent", function(event, ...)
|
||||
if (NewPlugin.OnEvent) then
|
||||
return NewPlugin:OnEvent (event, ...)
|
||||
end
|
||||
end)
|
||||
|
||||
Frame:SetFrameStrata ("HIGH")
|
||||
Frame:SetFrameLevel (6)
|
||||
|
||||
+5
-2
@@ -1001,11 +1001,14 @@ end
|
||||
|
||||
FlashAnimation.fadeOut = FlashAnimation:CreateAnimation ("Alpha") --> fade out anime
|
||||
FlashAnimation.fadeOut:SetOrder (1)
|
||||
FlashAnimation.fadeOut:SetChange (1)
|
||||
|
||||
FlashAnimation.fadeOut:SetFromAlpha (0)
|
||||
FlashAnimation.fadeOut:SetToAlpha (1)
|
||||
|
||||
FlashAnimation.fadeIn = FlashAnimation:CreateAnimation ("Alpha") --> fade in anime
|
||||
FlashAnimation.fadeIn:SetOrder (2)
|
||||
FlashAnimation.fadeIn:SetChange (-1)
|
||||
FlashAnimation.fadeIn:SetFromAlpha (0)
|
||||
FlashAnimation.fadeIn:SetToAlpha (1)
|
||||
|
||||
frame.FlashAnimation = FlashAnimation
|
||||
FlashAnimation.frame = frame
|
||||
|
||||
+2
-2
@@ -795,7 +795,7 @@
|
||||
local white_table = {1, 1, 1, 1}
|
||||
local black_table = {0, 0, 0, 1}
|
||||
local gray_table = {0.37, 0.37, 0.37, 0.95}
|
||||
|
||||
|
||||
local preset2_backdrop = {bgFile = [[Interface\AddOns\Details\images\background]], edgeFile = [[Interface\Buttons\WHITE8X8]], tile=true,
|
||||
edgeSize = 1, tileSize = 64, insets = {left = 0, right = 0, top = 0, bottom = 0}}
|
||||
_detalhes.cooltip_preset2_backdrop = preset2_backdrop
|
||||
@@ -1722,7 +1722,7 @@
|
||||
end
|
||||
|
||||
local reset = gump:NewLabel (panel, panel, nil, nil, "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:" .. 20 .. ":" .. 20 .. ":0:1:512:512:8:70:328:409|t " .. Loc ["STRING_OPTIONS_CLASSCOLOR_RESET"])
|
||||
reset:SetPoint ("bottomright", panel, "bottomright", -23, 38)
|
||||
reset:SetPoint ("bottomright", panel, "bottomright", -23, 08)
|
||||
local reset_texture = gump:CreateImage (panel, [[Interface\MONEYFRAME\UI-MONEYFRAME-BORDER]], 138, 45, "border")
|
||||
reset_texture:SetPoint ("center", reset, "center", 0, -7)
|
||||
reset_texture:SetDesaturated (true)
|
||||
|
||||
@@ -1727,7 +1727,6 @@
|
||||
local name_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraName", "$parentAuraName")
|
||||
name_textentry:SetPoint ("left", name_label, "right", 2, 0)
|
||||
f.name = name_textentry
|
||||
f.entry_name = name_textentry
|
||||
|
||||
--aura type
|
||||
local on_select_aura_type = function (_, _, aura_type)
|
||||
|
||||
@@ -612,6 +612,9 @@ local default_profile = {
|
||||
--> spec coords
|
||||
-- /run Details.class_specs_coords = nil
|
||||
class_specs_coords = {
|
||||
[577] = {128/512, 192/512, 256/512, 320/512}, --> havoc demon hunter
|
||||
[581] = {192/512, 256/512, 256/512, 320/512}, --> vengeance demon hunter
|
||||
|
||||
[250] = {0, 64/512, 0, 64/512}, --> blood dk
|
||||
[251] = {64/512, 128/512, 0, 64/512}, --> frost dk
|
||||
[252] = {128/512, 192/512, 0, 64/512}, --> unholy dk
|
||||
@@ -661,6 +664,12 @@ local default_profile = {
|
||||
--> class icons and colors
|
||||
class_icons_small = [[Interface\AddOns\Details\images\classes_small]],
|
||||
class_coords = {
|
||||
["DEMONHUNTER"] = {
|
||||
0.73828126, -- [1]
|
||||
1, -- [2]
|
||||
0.5, -- [3]
|
||||
0.75, -- [4]
|
||||
},
|
||||
["HUNTER"] = {
|
||||
0, -- [1]
|
||||
0.25, -- [2]
|
||||
@@ -772,6 +781,11 @@ local default_profile = {
|
||||
},
|
||||
|
||||
class_colors = {
|
||||
["DEMONHUNTER"] = {
|
||||
0.64,
|
||||
0.19,
|
||||
0.79,
|
||||
},
|
||||
["HUNTER"] = {
|
||||
0.67, -- [1]
|
||||
0.83, -- [2]
|
||||
|
||||
+266
-253
@@ -2086,276 +2086,289 @@ local _
|
||||
|
||||
})
|
||||
|
||||
--alpha = 0.4980392451398075,
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_detalhes:InstallSkin ("Overwatch", {
|
||||
file = [[Interface\AddOns\Details\images\skins\overwatch]],
|
||||
author = "Details!",
|
||||
version = "1.0",
|
||||
site = "unknown",
|
||||
desc = "Based on the new shooter from Blizzard.",
|
||||
|
||||
--general
|
||||
can_change_alpha_head = true,
|
||||
|
||||
--icon anchors
|
||||
icon_anchor_main = {-4, -5},
|
||||
icon_anchor_plugins = {-7, -13},
|
||||
icon_plugins_size = {19, 18},
|
||||
|
||||
--micro frames
|
||||
micro_frames = {
|
||||
color = {1, 1, 1, 0.7},
|
||||
font = "FORCED SQUARE",
|
||||
size = 10,
|
||||
textymod = 1,
|
||||
},
|
||||
|
||||
-- the four anchors (for when the toolbar is on the top side)
|
||||
icon_point_anchor = {-35, -0.5},
|
||||
left_corner_anchor = {-107, 0},
|
||||
right_corner_anchor = {96, 0},
|
||||
|
||||
-- the four anchors (for when the toolbar is on the bottom side)
|
||||
icon_point_anchor_bottom = {-37, 12},
|
||||
left_corner_anchor_bottom = {-107, 0},
|
||||
right_corner_anchor_bottom = {96, 0},
|
||||
|
||||
--[[ callback function execute after all changes on the window, first argument is this skin table, second is the instance where the skin was applied --]]
|
||||
callback = function (self, instance) end,
|
||||
--[[ control_script is a OnUpdate script, it start right after all changes on the window and also after the callback --]]
|
||||
--[[ control_script_on_start run before the control_script, use it to reset values if needed --]]
|
||||
control_script_on_start = nil,
|
||||
control_script = nil,
|
||||
|
||||
--instance overwrites
|
||||
--[[ when a skin is selected, all customized properties of the window is reseted and then the overwrites are applied]]
|
||||
--[[ for the complete cprop list see the file classe_instancia_include.lua]]
|
||||
|
||||
icon_on_top = true,
|
||||
icon_ignore_alpha = true,
|
||||
icon_titletext_position = {2, 5},
|
||||
|
||||
instance_cprops = {
|
||||
["menu_icons_size"] = 0.899999976158142,
|
||||
["color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
1, -- [4]
|
||||
_detalhes:InstallSkin ("Safe Skin Legion Beta", {
|
||||
file = [[Interface\AddOns\Details\images\skins\classic_skin_v1]],
|
||||
author = "Details!",
|
||||
version = "1.0",
|
||||
site = "unknown",
|
||||
desc = "Simple skin with soft gray color and half transparent frames.", --\n
|
||||
|
||||
--micro frames
|
||||
micro_frames = {
|
||||
color = {1, 1, 1, 1},
|
||||
font = "Accidental Presidency",
|
||||
size = 10,
|
||||
textymod = 1,
|
||||
},
|
||||
["menu_anchor"] = {
|
||||
17, -- [1]
|
||||
1, -- [2]
|
||||
["side"] = 2,
|
||||
},
|
||||
["bg_r"] = 1,
|
||||
["color_buttons"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
1, -- [4]
|
||||
},
|
||||
["bars_grow_direction"] = 1,
|
||||
["menu_anchor_down"] = {
|
||||
16, -- [1]
|
||||
-2, -- [2]
|
||||
},
|
||||
["bars_sort_direction"] = 1,
|
||||
["total_bar"] = {
|
||||
["enabled"] = false,
|
||||
["only_in_group"] = true,
|
||||
["icon"] = "Interface\\ICONS\\INV_Sigil_Thorim",
|
||||
|
||||
can_change_alpha_head = true,
|
||||
icon_anchor_main = {-1, -5},
|
||||
icon_anchor_plugins = {-7, -13},
|
||||
icon_plugins_size = {19, 18},
|
||||
|
||||
--anchors:
|
||||
icon_point_anchor = {-37, 0},
|
||||
left_corner_anchor = {-107, 0},
|
||||
right_corner_anchor = {96, 0},
|
||||
|
||||
icon_point_anchor_bottom = {-37, 12},
|
||||
left_corner_anchor_bottom = {-107, 0},
|
||||
right_corner_anchor_bottom = {96, 0},
|
||||
|
||||
icon_on_top = true,
|
||||
icon_ignore_alpha = true,
|
||||
icon_titletext_position = {3, 3},
|
||||
|
||||
--overwrites
|
||||
instance_cprops = {
|
||||
["show_statusbar"] = false,
|
||||
["menu_icons_size"] = 0.850000023841858,
|
||||
["color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
0.333333333333333, -- [1]
|
||||
0.333333333333333, -- [2]
|
||||
0.333333333333333, -- [3]
|
||||
0, -- [4]
|
||||
},
|
||||
},
|
||||
["instance_button_anchor"] = {
|
||||
-27, -- [1]
|
||||
1, -- [2]
|
||||
},
|
||||
["version"] = 3,
|
||||
["row_info"] = {
|
||||
["textR_outline"] = true,
|
||||
["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal",
|
||||
["textL_outline"] = true,
|
||||
["texture_highlight"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight",
|
||||
["textR_show_data"] = {
|
||||
true, -- [1]
|
||||
true, -- [2]
|
||||
true, -- [3]
|
||||
["menu_anchor"] = {
|
||||
16, -- [1]
|
||||
0, -- [2]
|
||||
["side"] = 2,
|
||||
},
|
||||
["percent_type"] = 1,
|
||||
["fixed_text_color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
},
|
||||
["space"] = {
|
||||
["right"] = 0,
|
||||
["left"] = 0,
|
||||
["between"] = 1,
|
||||
},
|
||||
["texture_background_class_color"] = false,
|
||||
["start_after_icon"] = true,
|
||||
["font_face_file"] = "Interface\\Addons\\Details\\fonts\\Accidental Presidency.ttf",
|
||||
["textL_custom_text"] = "{data1}. {data3}{data2}",
|
||||
["font_size"] = 10,
|
||||
["height"] = 14,
|
||||
["texture_file"] = "Interface\\Addons\\Grid2\\media\\white16x16",
|
||||
["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small_alpha",
|
||||
["textR_bracket"] = "(",
|
||||
["textR_enable_custom_text"] = true,
|
||||
["fixed_texture_color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
0.379999995231628, -- [4]
|
||||
},
|
||||
["textL_show_number"] = true,
|
||||
["backdrop"] = {
|
||||
["bg_r"] = 0.0941176470588235,
|
||||
["hide_out_of_combat"] = false,
|
||||
["following"] = {
|
||||
["bar_color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
},
|
||||
["enabled"] = false,
|
||||
["size"] = 4,
|
||||
["text_color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
},
|
||||
},
|
||||
["color_buttons"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
1, -- [4]
|
||||
},
|
||||
["skin_custom"] = "",
|
||||
["menu_anchor_down"] = {
|
||||
16, -- [1]
|
||||
-3, -- [2]
|
||||
},
|
||||
["micro_displays_locked"] = true,
|
||||
["row_show_animation"] = {
|
||||
["anim"] = "Fade",
|
||||
["options"] = {
|
||||
},
|
||||
},
|
||||
["tooltip"] = {
|
||||
["n_abilities"] = 3,
|
||||
["n_enemies"] = 3,
|
||||
},
|
||||
["total_bar"] = {
|
||||
["enabled"] = false,
|
||||
["only_in_group"] = true,
|
||||
["icon"] = "Interface\\ICONS\\INV_Sigil_Thorim",
|
||||
["color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
},
|
||||
},
|
||||
["show_sidebars"] = false,
|
||||
["instance_button_anchor"] = {
|
||||
-27, -- [1]
|
||||
1, -- [2]
|
||||
},
|
||||
["row_info"] = {
|
||||
["textR_outline"] = false,
|
||||
["spec_file"] = "Interface\\AddOns\\Details\\images\\spec_icons_normal",
|
||||
["textL_outline"] = false,
|
||||
["texture_highlight"] = "Interface\\FriendsFrame\\UI-FriendsList-Highlight",
|
||||
["textR_show_data"] = {
|
||||
true, -- [1]
|
||||
true, -- [2]
|
||||
true, -- [3]
|
||||
},
|
||||
["textL_enable_custom_text"] = false,
|
||||
["fixed_text_color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
},
|
||||
["space"] = {
|
||||
["right"] = 0,
|
||||
["left"] = 0,
|
||||
["between"] = 0,
|
||||
},
|
||||
["texture_background_class_color"] = false,
|
||||
["start_after_icon"] = false,
|
||||
["font_face_file"] = "Interface\\Addons\\Details\\fonts\\Accidental Presidency.ttf",
|
||||
["backdrop"] = {
|
||||
["enabled"] = false,
|
||||
["size"] = 12,
|
||||
["color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
1, -- [4]
|
||||
},
|
||||
["texture"] = "Details BarBorder 2",
|
||||
},
|
||||
["font_size"] = 10,
|
||||
["height"] = 14,
|
||||
["texture_file"] = "Interface\\RaidFrame\\Raid-Bar-Hp-Fill",
|
||||
["icon_file"] = "Interface\\AddOns\\Details\\images\\classes_small",
|
||||
["textR_bracket"] = "(",
|
||||
["textR_enable_custom_text"] = false,
|
||||
["fixed_texture_color"] = {
|
||||
0, -- [1]
|
||||
0, -- [2]
|
||||
0, -- [3]
|
||||
1, -- [4]
|
||||
},
|
||||
["texture"] = "Details BarBorder 2",
|
||||
["textL_show_number"] = true,
|
||||
["textL_custom_text"] = "{data1}. {data3}{data2}",
|
||||
["textR_custom_text"] = "{data1} ({data2}, {data3}%)",
|
||||
["fixed_texture_background_color"] = {
|
||||
0, -- [1]
|
||||
0, -- [2]
|
||||
0, -- [3]
|
||||
0.150228589773178, -- [4]
|
||||
},
|
||||
["models"] = {
|
||||
["upper_model"] = "Spells\\AcidBreath_SuperGreen.M2",
|
||||
["lower_model"] = "World\\EXPANSION02\\DOODADS\\Coldarra\\COLDARRALOCUS.m2",
|
||||
["upper_alpha"] = 0.5,
|
||||
["lower_enabled"] = false,
|
||||
["lower_alpha"] = 0.1,
|
||||
["upper_enabled"] = false,
|
||||
},
|
||||
["texture_custom_file"] = "Interface\\",
|
||||
["textR_class_colors"] = false,
|
||||
["texture_custom"] = "",
|
||||
["texture"] = "Blizzard Raid Bar",
|
||||
["textL_class_colors"] = false,
|
||||
["alpha"] = 1,
|
||||
["no_icon"] = false,
|
||||
["texture_background"] = "Details D'ictum (reverse)",
|
||||
["texture_background_file"] = "Interface\\AddOns\\Details\\images\\bar4_reverse",
|
||||
["font_face"] = "Accidental Presidency",
|
||||
["texture_class_colors"] = true,
|
||||
["percent_type"] = 1,
|
||||
["fast_ps_update"] = false,
|
||||
["textR_separator"] = ",",
|
||||
["use_spec_icons"] = true,
|
||||
},
|
||||
["textR_custom_text"] = "{data1} (|cffC9C9C9{data2}, {data3}%|r)",
|
||||
["fixed_texture_background_color"] = {
|
||||
0, -- [1]
|
||||
0, -- [2]
|
||||
0, -- [3]
|
||||
0.208013236522675, -- [4]
|
||||
["plugins_grow_direction"] = 1,
|
||||
["menu_alpha"] = {
|
||||
["enabled"] = false,
|
||||
["onleave"] = 1,
|
||||
["ignorebars"] = false,
|
||||
["iconstoo"] = true,
|
||||
["onenter"] = 1,
|
||||
},
|
||||
["models"] = {
|
||||
["upper_model"] = "Spells\\AcidBreath_SuperGreen.M2",
|
||||
["lower_model"] = "World\\EXPANSION02\\DOODADS\\Coldarra\\COLDARRALOCUS.m2",
|
||||
["upper_alpha"] = 0.5,
|
||||
["lower_enabled"] = false,
|
||||
["lower_alpha"] = 0.1,
|
||||
["upper_enabled"] = false,
|
||||
},
|
||||
["texture_custom_file"] = "Interface\\",
|
||||
["textL_class_colors"] = false,
|
||||
["texture_custom"] = "",
|
||||
["texture"] = "Grid2 Flat",
|
||||
["textR_class_colors"] = false,
|
||||
["alpha"] = 0.379999995231628,
|
||||
["no_icon"] = false,
|
||||
["texture_background"] = "DGround",
|
||||
["texture_background_file"] = "Interface\\AddOns\\Details\\images\\bar_background",
|
||||
["font_face"] = "Accidental Presidency",
|
||||
["texture_class_colors"] = false,
|
||||
["textL_enable_custom_text"] = true,
|
||||
["fast_ps_update"] = false,
|
||||
["textR_separator"] = ",",
|
||||
["use_spec_icons"] = true,
|
||||
},
|
||||
["menu_alpha"] = {
|
||||
["enabled"] = false,
|
||||
["onenter"] = 1,
|
||||
["iconstoo"] = true,
|
||||
["ignorebars"] = false,
|
||||
["onleave"] = 1,
|
||||
},
|
||||
["micro_displays_locked"] = true,
|
||||
["grab_on_top"] = false,
|
||||
["strata"] = "BACKGROUND",
|
||||
["row_show_animation"] = {
|
||||
["anim"] = "Fade",
|
||||
["options"] = {
|
||||
},
|
||||
},
|
||||
["statusbar_info"] = {
|
||||
["alpha"] = 1,
|
||||
["overlay"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
},
|
||||
},
|
||||
["menu_icons"] = {
|
||||
true, -- [1]
|
||||
true, -- [2]
|
||||
true, -- [3]
|
||||
true, -- [4]
|
||||
true, -- [5]
|
||||
false, -- [6]
|
||||
["space"] = -2,
|
||||
["shadow"] = true,
|
||||
},
|
||||
["desaturated_menu"] = true,
|
||||
["micro_displays_side"] = 2,
|
||||
["window_scale"] = 1,
|
||||
["bars_inverted"] = false,
|
||||
["hide_icon"] = true,
|
||||
["bg_alpha"] = 0,
|
||||
["toolbar_side"] = 1,
|
||||
["bg_g"] = 1,
|
||||
["backdrop_texture"] = "Solid",
|
||||
["show_statusbar"] = false,
|
||||
["plugins_grow_direction"] = 1,
|
||||
["wallpaper"] = {
|
||||
["enabled"] = true,
|
||||
["texture"] = "Interface\\AddOns\\Details\\images\\skins\\overwatch",
|
||||
["texcoord"] = {
|
||||
0.0580000019073486, -- [1]
|
||||
0.275, -- [2]
|
||||
0.765, -- [3]
|
||||
0.644000015258789, -- [4]
|
||||
},
|
||||
["overlay"] = {
|
||||
0.999997794628143, -- [1]
|
||||
0.999997794628143, -- [2]
|
||||
0.999997794628143, -- [3]
|
||||
0.498038113117218, -- [4]
|
||||
},
|
||||
["anchor"] = "all",
|
||||
["height"] = 226.000061035156,
|
||||
["alpha"] = 0.498039245605469,
|
||||
["width"] = 266.000061035156,
|
||||
},
|
||||
["stretch_button_side"] = 1,
|
||||
["show_sidebars"] = false,
|
||||
["attribute_text"] = {
|
||||
["show_timer"] = {
|
||||
["micro_displays_side"] = 2,
|
||||
["grab_on_top"] = false,
|
||||
["strata"] = "LOW",
|
||||
["bars_grow_direction"] = 1,
|
||||
["bg_alpha"] = 0.045324444770813,
|
||||
["ignore_mass_showhide"] = false,
|
||||
["hide_in_combat_alpha"] = 0,
|
||||
["menu_icons"] = {
|
||||
true, -- [1]
|
||||
true, -- [2]
|
||||
true, -- [3]
|
||||
true, -- [4]
|
||||
true, -- [5]
|
||||
false, -- [6]
|
||||
["space"] = -2,
|
||||
["shadow"] = false,
|
||||
},
|
||||
["shadow"] = false,
|
||||
["side"] = 1,
|
||||
["text_color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
0.917582094669342, -- [4]
|
||||
["auto_hide_menu"] = {
|
||||
["left"] = false,
|
||||
["right"] = false,
|
||||
},
|
||||
["custom_text"] = "{name}",
|
||||
["text_face"] = "Accidental Presidency",
|
||||
["anchor"] = {
|
||||
-20, -- [1]
|
||||
3, -- [2]
|
||||
["statusbar_info"] = {
|
||||
["alpha"] = 0,
|
||||
["overlay"] = {
|
||||
0.333333333333333, -- [1]
|
||||
0.333333333333333, -- [2]
|
||||
0.333333333333333, -- [3]
|
||||
},
|
||||
},
|
||||
["text_size"] = 14,
|
||||
["enable_custom_text"] = false,
|
||||
["enabled"] = true,
|
||||
["window_scale"] = 1,
|
||||
["libwindow"] = {
|
||||
["y"] = 90.9987335205078,
|
||||
["x"] = -80.0020751953125,
|
||||
["point"] = "BOTTOMRIGHT",
|
||||
},
|
||||
["backdrop_texture"] = "Details Ground",
|
||||
["hide_icon"] = true,
|
||||
["bg_b"] = 0.0941176470588235,
|
||||
["toolbar_side"] = 1,
|
||||
["bg_g"] = 0.0941176470588235,
|
||||
["desaturated_menu"] = false,
|
||||
["wallpaper"] = {
|
||||
["enabled"] = false,
|
||||
["texcoord"] = {
|
||||
0, -- [1]
|
||||
1, -- [2]
|
||||
0, -- [3]
|
||||
0.7, -- [4]
|
||||
},
|
||||
["overlay"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
1, -- [4]
|
||||
},
|
||||
["anchor"] = "all",
|
||||
["height"] = 114.042518615723,
|
||||
["alpha"] = 0.5,
|
||||
["width"] = 283.000183105469,
|
||||
},
|
||||
["stretch_button_side"] = 1,
|
||||
["attribute_text"] = {
|
||||
["enabled"] = true,
|
||||
["shadow"] = false,
|
||||
["side"] = 1,
|
||||
["text_size"] = 12,
|
||||
["custom_text"] = "{name}",
|
||||
["text_face"] = "Accidental Presidency",
|
||||
["anchor"] = {
|
||||
-18, -- [1]
|
||||
3, -- [2]
|
||||
},
|
||||
["text_color"] = {
|
||||
1, -- [1]
|
||||
1, -- [2]
|
||||
1, -- [3]
|
||||
1, -- [4]
|
||||
},
|
||||
["enable_custom_text"] = false,
|
||||
["show_timer"] = {
|
||||
true, -- [1]
|
||||
true, -- [2]
|
||||
true, -- [3]
|
||||
},
|
||||
},
|
||||
["bars_sort_direction"] = 1,
|
||||
},
|
||||
["bg_b"] = 1,
|
||||
},
|
||||
|
||||
skin_options = {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
callback = function (skin, instance, just_updating)
|
||||
--none
|
||||
end,
|
||||
|
||||
skin_options = {
|
||||
{spacement = true, type = "button", name = "Shadowy Title Bar", func = Minimalistic_Shadow, desc = "Adds shadow on title bar components."},
|
||||
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_RESET_TOOLTIP"], func = reset_tooltip, desc = Loc ["STRING_OPTIONS_SKIN_RESET_TOOLTIP_DESC"]},
|
||||
{type = "button", name = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3"], func = set_tooltip_elvui2, desc = Loc ["STRING_OPTIONS_SKIN_ELVUI_BUTTON3_DESC"]},
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
@@ -1103,6 +1103,74 @@ function SlashCmdList.DETAILS (msg, editbox)
|
||||
--C_Timer.After (5, function() bar:CancelTimerBar() end)
|
||||
|
||||
|
||||
elseif (msg == "q") then
|
||||
|
||||
local myframe = TestFrame
|
||||
if (not myframe) then
|
||||
myframe = TestFrame or CreateFrame ("frame", "TestFrame", UIParent)
|
||||
myframe:SetPoint ("center", UIParent, "center")
|
||||
myframe:SetSize (300, 300)
|
||||
myframe.texture = myframe:CreateTexture (nil, "overlay")
|
||||
myframe.texture:SetAllPoints()
|
||||
myframe.texture:SetTexture ([[Interface\AddOns\WorldQuestTracker\media\icon_flag_common]])
|
||||
else
|
||||
if (myframe.texture:IsShown()) then
|
||||
myframe.texture:Hide()
|
||||
else
|
||||
print (myframe.texture:GetTexture())
|
||||
myframe.texture:Show()
|
||||
print (myframe.texture:GetTexture())
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
if (true) then
|
||||
return
|
||||
end
|
||||
|
||||
local y = -50
|
||||
local allspecs = {}
|
||||
|
||||
for a, b in pairs (_detalhes.class_specs_coords) do
|
||||
tinsert (allspecs, a)
|
||||
end
|
||||
|
||||
for i = 1, 10 do
|
||||
|
||||
local a = CreateFrame ("statusbar", nil, UIParent)
|
||||
a:SetPoint ("topleft", UIParent, "topleft", i*32, y)
|
||||
a:SetSize (32, 32)
|
||||
a:SetMinMaxValues (0, 1)
|
||||
|
||||
local texture = a:CreateTexture (nil, "overlay")
|
||||
texture:SetSize (32, 32)
|
||||
texture:SetPoint ("topleft")
|
||||
|
||||
if (i%10 == 0) then
|
||||
y = y - 32
|
||||
end
|
||||
|
||||
-- /run for o=1,10 do local f=CreateFrame("frame");f:SetPoint("center");f:SetSize(300,300); local t=f:CreateTexture(nil,"overlay");t:SetAllPoints();f:SetScript("OnUpdate",function() t:SetTexture("Interface\\1024")end);end;
|
||||
-- https://www.dropbox.com/s/ulyeqa2z0ummlu7/1024.tga?dl=0
|
||||
|
||||
local time = 0
|
||||
a:SetScript ("OnUpdate", function (self, deltaTime)
|
||||
time = time + deltaTime
|
||||
|
||||
--texture:SetSize (math.random (50, 300), math.random (50, 300))
|
||||
--local spec = allspecs [math.random (#allspecs)]
|
||||
texture:SetTexture ([[Interface\AddOns\Details\images\options_window]])
|
||||
--texture:SetTexture ([[Interface\Store\Store-Splash]])
|
||||
--texture:SetTexture ([[Interface\AddOns\Details\images\options_window]])
|
||||
--texture:SetTexture ([[Interface\CHARACTERFRAME\Button_BloodPresence_DeathKnight]])
|
||||
--texture:SetTexCoord (unpack (_detalhes.class_specs_coords [spec]))
|
||||
|
||||
--a:SetAlpha (abs (math.sin (time)))
|
||||
--a:SetValue (abs (math.sin (time)))
|
||||
end)
|
||||
end
|
||||
|
||||
elseif (msg == "alert") then
|
||||
--local instancia = _detalhes.tabela_instancias [1]
|
||||
local f = function (a, b, c, d, e, f, g) print (a, b, c, d, e, f, g) end
|
||||
|
||||
@@ -86,16 +86,16 @@ do
|
||||
[88082] = {name = GetSpellInfo (88082) .. " (" .. Loc ["STRING_MIRROR_IMAGE"] .. ")"}, --> Mirror Image's Fireball (mage)
|
||||
|
||||
[94472] = {name = GetSpellInfo (94472) .. " (" .. Loc ["STRING_CRITICAL_ONLY"] .. ")"}, --> Atonement critical hit (priest)
|
||||
[140816] = {name = GetSpellInfo (140816) .. " (" .. Loc ["STRING_CRITICAL_ONLY"] .. ")"}, --> Power Word: Solace critical hit (priest)
|
||||
--[140816] = {name = GetSpellInfo (140816) .. " (" .. Loc ["STRING_CRITICAL_ONLY"] .. ")"}, --> Power Word: Solace critical hit (priest)
|
||||
|
||||
[33778] = {name = GetSpellInfo (33778) .. " (bloom)"}, --lifebloom (bloom)
|
||||
|
||||
[121414] = {name = GetSpellInfo (121414) .. " (Glaive #1)"}, --> glaive toss (hunter)
|
||||
[120761] = {name = GetSpellInfo (120761) .. " (Glaive #2)"}, --> glaive toss (hunter)
|
||||
|
||||
[108686] = {name = GetSpellInfo (108686) .. " (" .. GetSpellInfo (108683) .. ")" }, --> immolate (brimstone)
|
||||
[108685] = {name = GetSpellInfo (108685) .. " (" .. GetSpellInfo (108683) .. ")" }, --> conflagrate (brimstone)
|
||||
[114654] = {name = GetSpellInfo (114654) .. " (" .. GetSpellInfo (108683) .. ")" }, --> incinetate (brimstone)
|
||||
--[108686] = {name = GetSpellInfo (108686) .. " (" .. GetSpellInfo (108683) .. ")" }, --> immolate (brimstone)
|
||||
--[108685] = {name = GetSpellInfo (108685) .. " (" .. GetSpellInfo (108683) .. ")" }, --> conflagrate (brimstone)
|
||||
--[114654] = {name = GetSpellInfo (114654) .. " (" .. GetSpellInfo (108683) .. ")" }, --> incinetate (brimstone)
|
||||
}
|
||||
|
||||
-- removed on warlords of draenor:
|
||||
|
||||
@@ -17,6 +17,41 @@ do
|
||||
}
|
||||
|
||||
_detalhes.SpecSpellList = {
|
||||
|
||||
--demonhunter shared
|
||||
-- [185123] = ??, -- "Throw Glaive"
|
||||
-- [196718] = ??, -- "Darkness"
|
||||
-- [183752] = ??, -- "Consume Magic"
|
||||
-- [131347] = ??, -- "Glide"
|
||||
-- [200166] = ??, -- "Metamorphosis"
|
||||
|
||||
-- havoc demon hunter --577
|
||||
[198793] = 577, -- "Vengeful Retreat"
|
||||
[162243] = 577, -- "Demon's Bite"
|
||||
[213241] = 577, -- "Felblade"
|
||||
[213243] = 577, -- "Felblade"
|
||||
[179057] = 577, -- "Chaos Nova"
|
||||
[188499] = 577, -- "Blade Dance"
|
||||
[198013] = 577, -- "Eye Beam"
|
||||
[201467] = 577, -- "Fury of the Illidari"
|
||||
[178963] = 577, -- "Consume Soul"
|
||||
[162794] = 577, -- "Chaos Strike"
|
||||
[211881] = 577, -- "Fel Eruption"
|
||||
[201427] = 577, -- "Annihilation"
|
||||
[210152] = 577, -- "Death Sweep"
|
||||
|
||||
-- vengeance demon hunter --581
|
||||
[203782] = 581, -- "Shear"
|
||||
[203720] = 581, -- "Demon Spikes"
|
||||
[218256] = 581, -- "Empower Wards"
|
||||
[203798] = 581, -- "Soul Cleave"
|
||||
[202137] = 581, -- "Sigil of Silence"
|
||||
[204490] = 581, -- "Sigil of Silence"
|
||||
[204596] = 581, -- "Sigil of Flame"
|
||||
[204598] = 581, -- "Sigil of Flame"
|
||||
[204021] = 581, -- "Fiery Brand"
|
||||
[202138] = 581, -- "Sigil of Chains"
|
||||
[207407] = 581, -- "Soul Carver"
|
||||
|
||||
-- Unholy Death Knight:
|
||||
[165395] = 252, -- Necrosis
|
||||
|
||||
@@ -3148,7 +3148,7 @@ function gump:CriaJanelaInfo()
|
||||
|
||||
if (critical > bar2[3][3]) then
|
||||
local diff = critical - bar2[3][3]
|
||||
local up = diff / bar2[3][3] * 100
|
||||
local up = diff / math.max (bar2[3][3] * 100, 0.1)
|
||||
up = _math_floor (up)
|
||||
if (up > 999) then
|
||||
up = ">" .. 999
|
||||
@@ -3156,7 +3156,7 @@ function gump:CriaJanelaInfo()
|
||||
frame2.tooltip.crit_label2:SetText (bar2[3][3] .. "%" .. " |c" .. minor .. up .. "%)|r")
|
||||
else
|
||||
local diff = bar2[3][3] - critical
|
||||
local down = diff / critical * 100
|
||||
local down = diff / math.max (critical * 100, 0.1)
|
||||
down = _math_floor (down)
|
||||
if (down > 999) then
|
||||
down = ">" .. 999
|
||||
@@ -4439,12 +4439,18 @@ local function CriaTexturaBarra (instancia, barra)
|
||||
local texture = SharedMedia:Fetch ("statusbar", _detalhes.player_details_window.bar_texture)
|
||||
barra.textura:SetStatusBarTexture (texture)
|
||||
|
||||
--barra.textura:SetStatusBarTexture ([[Interface\AddOns\Details\Images\bar_skyline.tga]])
|
||||
--barra.textura:SetStatusBarTexture ([[Interface\AddOns\Details\Images\bar_serenity]])
|
||||
barra.textura:SetStatusBarTexture (.6, .6, .6, 1)
|
||||
|
||||
--print (texture, _detalhes.player_details_window.bar_texture)
|
||||
|
||||
barra.textura:SetStatusBarColor (.5, .5, .5, 0)
|
||||
barra.textura:SetMinMaxValues (0,100)
|
||||
|
||||
barra.textura.bg = barra.textura:CreateTexture (nil, "background")
|
||||
barra.textura.bg:SetAllPoints()
|
||||
barra.textura.bg:SetTexture (1, 1, 1, 0.08)
|
||||
barra.textura.bg:SetColorTexture (1, 1, 1, 0.08)
|
||||
|
||||
if (barra.targets) then
|
||||
barra.targets:SetParent (barra.textura)
|
||||
|
||||
@@ -3102,10 +3102,16 @@ local function CreateAlertFrame (baseframe, instancia)
|
||||
local anim1 = animation:CreateAnimation ("ALPHA")
|
||||
local anim2 = animation:CreateAnimation ("ALPHA")
|
||||
anim1:SetOrder (1)
|
||||
anim1:SetChange (1)
|
||||
|
||||
anim1:SetFromAlpha (0)
|
||||
anim1:SetToAlpha (1)
|
||||
|
||||
anim1:SetDuration (0.1)
|
||||
anim2:SetOrder (2)
|
||||
anim2:SetChange (-1)
|
||||
|
||||
anim1:SetFromAlpha (1)
|
||||
anim1:SetToAlpha (0)
|
||||
|
||||
anim2:SetDuration (0.2)
|
||||
animation:SetScript ("OnFinished", function (self)
|
||||
flash_texture:Hide()
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 445 KiB After Width: | Height: | Size: 4.0 MiB |
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details! 3D Model Viewer
|
||||
## Notes: When the 3d models option is enabled, this tool is used to select which model will be used on the window's rows.
|
||||
## DefaultState: Enabled
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details Calc Leech
|
||||
## Notes: Plugin for Details
|
||||
## RequiredDeps: Details
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details Storage
|
||||
## Notes: Stores information for Details!
|
||||
## DefaultState: Enabled
|
||||
|
||||
@@ -66,34 +66,34 @@ local function CreatePluginFrames (data)
|
||||
DmgRank.TimeGoal = {
|
||||
|
||||
--> The 30 seconds Trial
|
||||
{time = 30, damage = 350000, name = Loc ["CHALLENGENAME_1"]}, -- Ready to Raid -- rank 2 --> -- Patrulha --> ~11K DPS required
|
||||
{time = 30, damage = 420000, name = Loc ["CHALLENGENAME_2"]}, -- Damage Practice --rank 3 --> -- Soldier --> ~14K DPS required
|
||||
{time = 30, damage = 500000, name = Loc ["CHALLENGENAME_3"]}, -- The Training Continue... -- rank 4 --> -- Corporal --> ~16K DPS required
|
||||
{time = 30, damage = 3500000, name = Loc ["CHALLENGENAME_1"]}, -- Ready to Raid -- rank 2 --> -- Patrulha --> ~11K DPS required
|
||||
{time = 30, damage = 4200000, name = Loc ["CHALLENGENAME_2"]}, -- Damage Practice --rank 3 --> -- Soldier --> ~14K DPS required
|
||||
{time = 30, damage = 5000000, name = Loc ["CHALLENGENAME_3"]}, -- The Training Continue... -- rank 4 --> -- Corporal --> ~16K DPS required
|
||||
|
||||
--> 90 seconds bracket
|
||||
{time = 90, damage = 1601010, name = Loc ["CHALLENGENAME_4"]}, -- You Just Need a Little More Time -- rank 5 --> -- Sergeant --> ~17K DPS required
|
||||
{time = 90, damage = 1666660, name = Loc ["CHALLENGENAME_5"]}, -- Became a Knight -- rank 6 --> -- Sergeant --> ~18K DPS required
|
||||
{time = 90, damage = 16010100, name = Loc ["CHALLENGENAME_4"]}, -- You Just Need a Little More Time -- rank 5 --> -- Sergeant --> ~17K DPS required
|
||||
{time = 90, damage = 16666600, name = Loc ["CHALLENGENAME_5"]}, -- Became a Knight -- rank 6 --> -- Sergeant --> ~18K DPS required
|
||||
|
||||
--> middle bracket
|
||||
{time = 120, damage = 2254120, name = Loc ["CHALLENGENAME_6"]}, -- Two Minutes -- rank 7 --> Iron Knight --> ~18K DPS required
|
||||
{time = 120, damage = 2409500, name = Loc ["CHALLENGENAME_7"]}, --rank 8 --> Steel Knight --> ~20K DPS required
|
||||
{time = 180, damage = 3390000, name = Loc ["CHALLENGENAME_8"]}, --rank 9 --> --> The High Knight --> ~18K DPS required
|
||||
{time = 180, damage = 3499000, name = Loc ["CHALLENGENAME_9"]}, --rank 10 --> Yes Sir! -- Thorium Knight --> ~19K DPS required
|
||||
{time = 180, damage = 3784051, name = Loc ["CHALLENGENAME_10"]}, --rank 11 --> Salute -- Silver Lieutenant --> ~21K DPS required
|
||||
{time = 120, damage = 22541200, name = Loc ["CHALLENGENAME_6"]}, -- Two Minutes -- rank 7 --> Iron Knight --> ~18K DPS required
|
||||
{time = 120, damage = 24095000, name = Loc ["CHALLENGENAME_7"]}, --rank 8 --> Steel Knight --> ~20K DPS required
|
||||
{time = 180, damage = 33900000, name = Loc ["CHALLENGENAME_8"]}, --rank 9 --> --> The High Knight --> ~18K DPS required
|
||||
{time = 180, damage = 34990000, name = Loc ["CHALLENGENAME_9"]}, --rank 10 --> Yes Sir! -- Thorium Knight --> ~19K DPS required
|
||||
{time = 180, damage = 37840510, name = Loc ["CHALLENGENAME_10"]}, --rank 11 --> Salute -- Silver Lieutenant --> ~21K DPS required
|
||||
|
||||
--> burst bracket
|
||||
{time = 40, damage = 1351144, name = Loc ["CHALLENGENAME_11"]}, --rank 12 --> In Burst We Trust -- Gold Lieutenant --> ~33K DPS required
|
||||
{time = 40, damage = 1494404, name = Loc ["CHALLENGENAME_12"]}, --rank 13 --> Watch me Explode -- Stone Guardian --> ~37K DPS required
|
||||
{time = 40, damage = 1569900, name = Loc ["CHALLENGENAME_13"]}, --rank 14 --> T.N.T-- Fel Guardian --> ~39K DPS required
|
||||
{time = 40, damage = 13511440, name = Loc ["CHALLENGENAME_11"]}, --rank 12 --> In Burst We Trust -- Gold Lieutenant --> ~33K DPS required
|
||||
{time = 40, damage = 14944040, name = Loc ["CHALLENGENAME_12"]}, --rank 13 --> Watch me Explode -- Stone Guardian --> ~37K DPS required
|
||||
{time = 40, damage = 15699000, name = Loc ["CHALLENGENAME_13"]}, --rank 14 --> T.N.T-- Fel Guardian --> ~39K DPS required
|
||||
|
||||
--> long run bracket
|
||||
{time = 300, damage = 6211201, name = Loc ["CHALLENGENAME_14"]}, --rank 15 --> Time is Damage My Friend -- Titan Guardian --> ~20K DPS required
|
||||
{time = 300, damage = 6842459, name = Loc ["CHALLENGENAME_15"]}, --rank 16 - Just a Little Patience --> Bronze Centurion --> ~22K DPS required
|
||||
{time = 300, damage = 7511983, name = Loc ["CHALLENGENAME_16"]}, --rank 17 --> Silver Centurion --> ~25K DPS required
|
||||
{time = 300, damage = 62112010, name = Loc ["CHALLENGENAME_14"]}, --rank 15 --> Time is Damage My Friend -- Titan Guardian --> ~20K DPS required
|
||||
{time = 300, damage = 68424590, name = Loc ["CHALLENGENAME_15"]}, --rank 16 - Just a Little Patience --> Bronze Centurion --> ~22K DPS required
|
||||
{time = 300, damage = 75119830, name = Loc ["CHALLENGENAME_16"]}, --rank 17 --> Silver Centurion --> ~25K DPS required
|
||||
|
||||
{time = 120, damage = 4011100, name = Loc ["CHALLENGENAME_17"]}, --rank 18 --> Flame Centurion --> ~33K DPS required
|
||||
{time = 120, damage = 4300000, name = Loc ["CHALLENGENAME_18"]}, --rank 19 --> Lower Vanquisher --> 35K DPS required
|
||||
{time = 60, damage = 2650000, name = Loc ["CHALLENGENAME_19"]}, --rank 20 --> Middle Vanquisher --> 44K DPS required
|
||||
{time = 120, damage = 40111000, name = Loc ["CHALLENGENAME_17"]}, --rank 18 --> Flame Centurion --> ~33K DPS required
|
||||
{time = 120, damage = 43000000, name = Loc ["CHALLENGENAME_18"]}, --rank 19 --> Lower Vanquisher --> 35K DPS required
|
||||
{time = 60, damage = 26500000, name = Loc ["CHALLENGENAME_19"]}, --rank 20 --> Middle Vanquisher --> 44K DPS required
|
||||
|
||||
--> end
|
||||
{time = nil, damage = nil, name = ""}, --rank 21 --> none
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details Damage, the Game! (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## RequiredDeps: Details
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details Dps Tuning (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## RequiredDeps: Details
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details: Warlords of Draenor Dungeons
|
||||
## Notes: Plugin for Details
|
||||
## RequiredDeps: Details
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details Encounter (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## RequiredDeps: Details
|
||||
|
||||
@@ -823,7 +823,7 @@ do
|
||||
|
||||
local t = f:CreateTexture (nil, "artwork")
|
||||
t:SetAllPoints()
|
||||
t:SetTexture (1, 1, 1, phase_alpha)
|
||||
t:SetColorTexture (1, 1, 1, phase_alpha)
|
||||
t.original_color = {1, 1, 1}
|
||||
f.texture = t
|
||||
|
||||
@@ -892,7 +892,7 @@ do
|
||||
for i = 1, 8, 1 do
|
||||
|
||||
local line = g:CreateTexture (nil, "overlay")
|
||||
line:SetTexture (.5, .5, .5, .7)
|
||||
line:SetColorTexture (.5, .5, .5, .7)
|
||||
line:SetWidth (670)
|
||||
line:SetHeight (1)
|
||||
line:SetVertexColor (.4, .4, .4, .8)
|
||||
@@ -915,7 +915,7 @@ do
|
||||
texture:SetWidth (9)
|
||||
texture:SetHeight (9)
|
||||
texture:SetPoint ("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", (i*65) + 299, -81)
|
||||
texture:SetTexture (unpack (grafico_cores[i]))
|
||||
texture:SetColorTexture (unpack (grafico_cores[i]))
|
||||
local text = g:CreateFontString (nil, "OVERLAY", "GameFontHighlightSmall")
|
||||
text:SetPoint ("LEFT", texture, "right", 2, 0)
|
||||
text:SetJustifyH ("LEFT")
|
||||
@@ -933,14 +933,14 @@ do
|
||||
v:SetHeight (238)
|
||||
v:SetPoint ("top", g, "top", 0, 1)
|
||||
v:SetPoint ("left", g, "left", 55, 0)
|
||||
v:SetTexture (1, 1, 1, 1)
|
||||
v:SetColorTexture (1, 1, 1, 1)
|
||||
|
||||
local h = g:CreateTexture (nil, "overlay")
|
||||
h:SetWidth (668)
|
||||
h:SetHeight (2)
|
||||
h:SetPoint ("top", g, "top", 0, -217)
|
||||
h:SetPoint ("left", g, "left")
|
||||
h:SetTexture (1, 1, 1, 1)
|
||||
h:SetColorTexture (1, 1, 1, 1)
|
||||
end
|
||||
|
||||
local BossFrame = EncounterDetails.Frame
|
||||
@@ -1293,7 +1293,7 @@ do
|
||||
u:SetAllPoints (BossFrame.buttonSwitchNormal)
|
||||
|
||||
selected = BossFrame.buttonSwitchGraphic:CreateTexture (nil, "overlay")
|
||||
selected:SetTexture (1, 1, 1, .1)
|
||||
selected:SetColorTexture (1, 1, 1, .1)
|
||||
selected:SetWidth (22)
|
||||
selected:SetHeight (28)
|
||||
selected:SetPoint ("center", BossFrame.buttonSwitchNormal, "center", 0, 0)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details Raid Check (plugin)
|
||||
## Notes: Show a icon on Details title bar showing flask, food, pre-pots.
|
||||
## RequiredDeps: Details
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details: Hellfire Citadel
|
||||
## Notes: Plugin for Details
|
||||
## RequiredDeps: Details
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details!: Streamer (plugin)
|
||||
## Notes: Show which spells you are casting, viewers can see what are you doing and follow your steps.
|
||||
## RequiredDeps: Details
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details TimeAttack (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## SavedVariablesPerCharacter: _detalhes_databaseTimeAttack
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details Tiny Threat (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## RequiredDeps: Details
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## Interface: 60200
|
||||
## Interface: 70000
|
||||
## Title: Details Vanguard (plugin)
|
||||
## Notes: Plugin for Details
|
||||
## SavedVariablesPerCharacter: _detalhes_databaseVanguard
|
||||
|
||||
Reference in New Issue
Block a user