More bug fixes

This commit is contained in:
Tercio Jose
2022-10-12 18:37:00 -03:00
parent 69899679e7
commit 6243a32740
90 changed files with 5200 additions and 5212 deletions
+5 -5
View File
@@ -782,13 +782,13 @@ for i = 1, #Details.APIText do
local text = Details.APIText [i]
--add the color to the text
text = text:gsub ([[@TITLE]], "|c" .. titleColor)
text = text:gsub ([[@CODE]], "|c" .. codeColor)
text = text:gsub ([[@DESC]], "|c" .. descColor)
text = text:gsub ([[@COMMENT]], "|c" .. luacomentColor)
text = text:gsub([[@TITLE]], "|c" .. titleColor)
text = text:gsub([[@CODE]], "|c" .. codeColor)
text = text:gsub([[@DESC]], "|c" .. descColor)
text = text:gsub([[@COMMENT]], "|c" .. luacomentColor)
--add the end color
text = text:gsub ([[@]], "|r")
text = text:gsub([[@]], "|r")
Details.APIText [i] = text
end
+2 -2
View File
@@ -219,12 +219,12 @@ local function DeserializeValue(iter,single,ctl,data)
if ctl=="^t" then break end -- ignore ^t's data
k = DeserializeValue(iter,true,ctl,data)
if k==nil then
error("Invalid AceSerializer table format (no table end marker)")
error("Invalid AceSerializer table format(no table end marker)")
end
ctl,data = iter()
v = DeserializeValue(iter,true,ctl,data)
if v==nil then
error("Invalid AceSerializer table format (no table end marker)")
error("Invalid AceSerializer table format(no table end marker)")
end
res[k]=v
end
+17 -20
View File
@@ -88,7 +88,6 @@ function DF:LoadAllSpells (hashMap, indexTable, allSpellsSameName)
end
elseif (hashMap and indexTable) then
--DF_CALC_PERFORMANCE()
if (allSpellsSameName) then
for i = 1, CONST_MAX_SPELLS do
local spellName = GetSpellInfo(i)
@@ -128,9 +127,6 @@ local cleanfunction = function() end
do
local metaPrototype = {
WidgetType = "aura_tracker",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
@@ -153,6 +149,7 @@ do
end
local AuraTrackerMetaFunctions = _G[DF.GlobalWidgetControlNames["aura_tracker"]]
DF:Mixin(AuraTrackerMetaFunctions, DF.ScriptHookMixin)
--create panels
local on_profile_changed = function(self, newdb)
@@ -357,13 +354,13 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
local buff_blacklist_label = self:CreateLabel(background_add_blacklist, texts.MANUAL_ADD_BLACKLIST_BUFF, DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
local debuff_blacklist_label = self:CreateLabel(background_add_blacklist, texts.MANUAL_ADD_BLACKLIST_DEBUFF, DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
local buff_name_blacklist_entry = self:CreateTextEntry (background_add_blacklist, function()end, textEntryWidth, 20, "AddBuffBlacklistTextBox", _, _, options_dropdown_template)
local buff_name_blacklist_entry = self:CreateTextEntry(background_add_blacklist, function()end, textEntryWidth, 20, "AddBuffBlacklistTextBox", _, _, options_dropdown_template)
buff_name_blacklist_entry:SetHook("OnEditFocusGained", load_all_spells)
buff_name_blacklist_entry:SetJustifyH("left")
buff_name_blacklist_entry.tooltip = "Enter the buff name using lower case letters."
f_auto.AddBuffBlacklistTextBox = buff_name_blacklist_entry
local debuff_name_blacklist_entry = self:CreateTextEntry (background_add_blacklist, function()end, textEntryWidth, 20, "AddDebuffBlacklistTextBox", _, _, options_dropdown_template)
local debuff_name_blacklist_entry = self:CreateTextEntry(background_add_blacklist, function()end, textEntryWidth, 20, "AddDebuffBlacklistTextBox", _, _, options_dropdown_template)
debuff_name_blacklist_entry:SetHook("OnEditFocusGained", load_all_spells)
debuff_name_blacklist_entry:SetJustifyH("left")
debuff_name_blacklist_entry.tooltip = "Enter the debuff name using lower case letters."
@@ -380,9 +377,9 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
local spellWithSameName = AllSpellsSameName [spellName]
if (spellWithSameName) then
if (t) then
t [spellName] = DF.table.copy ({}, spellWithSameName)
t [spellName] = DF.table.copy({}, spellWithSameName)
else
db.aura_cache_by_name [spellName] = DF.table.copy ({}, spellWithSameName)
db.aura_cache_by_name [spellName] = DF.table.copy({}, spellWithSameName)
end
end
end
@@ -391,7 +388,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
local get_spellID_from_string = function(text)
--check if the user entered a spell ID
local isSpellID = tonumber (text)
local isSpellID = tonumber(text)
if (isSpellID and isSpellID > 1 and isSpellID < 10000000) then
local isValidSpellID = GetSpellInfo(isSpellID)
if (isValidSpellID) then
@@ -530,13 +527,13 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
local buff_tracklist_label = self:CreateLabel(background_add_tracklist, texts.MANUAL_ADD_TRACKLIST_BUFF, DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
local debuff_tracklist_label = self:CreateLabel(background_add_tracklist, texts.MANUAL_ADD_TRACKLIST_DEBUFF, DF:GetTemplate("font", "OPTIONS_FONT_TEMPLATE"))
local buff_name_tracklist_entry = self:CreateTextEntry (background_add_tracklist, function()end, textEntryWidth, 20, "AddBuffTracklistTextBox", _, _, options_dropdown_template)
local buff_name_tracklist_entry = self:CreateTextEntry(background_add_tracklist, function()end, textEntryWidth, 20, "AddBuffTracklistTextBox", _, _, options_dropdown_template)
buff_name_tracklist_entry:SetHook("OnEditFocusGained", load_all_spells)
buff_name_tracklist_entry:SetJustifyH("left")
buff_name_tracklist_entry.tooltip = "Enter the buff name using lower case letters."
f_auto.AddBuffTracklistTextBox = buff_name_tracklist_entry
local debuff_name_tracklist_entry = self:CreateTextEntry (background_add_tracklist, function()end, textEntryWidth, 20, "AddDebuffTracklistTextBox", _, _, options_dropdown_template)
local debuff_name_tracklist_entry = self:CreateTextEntry(background_add_tracklist, function()end, textEntryWidth, 20, "AddDebuffTracklistTextBox", _, _, options_dropdown_template)
debuff_name_tracklist_entry:SetHook("OnEditFocusGained", load_all_spells)
debuff_name_tracklist_entry:SetJustifyH("left")
debuff_name_tracklist_entry.tooltip = "Enter the debuff name using lower case letters."
@@ -771,7 +768,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
line.name:SetText(spellName .. " (" .. spellID .. ")")
end
line.icon:SetTexture(spellIcon)
line.icon:SetTexCoord (.1, .9, .1, .9)
line.icon:SetTexCoord(.1, .9, .1, .9)
end
end
end
@@ -1024,7 +1021,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
if (name) then
line.name:SetText(name)
line.icon:SetTexture(icon)
line.icon:SetTexCoord (.1, .9, .1, .9)
line.icon:SetTexCoord(.1, .9, .1, .9)
else
line.name:SetText(aura)
line.icon:SetTexture([[Interface\InventoryItems\WoWUnknownItem01]])
@@ -1065,8 +1062,8 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
-- build the text entry to type the spellname
local new_buff_string = self:CreateLabel(f_manual, "Add Buff")
local new_debuff_string = self:CreateLabel(f_manual, "Add Debuff")
local new_buff_entry = self:CreateTextEntry (f_manual, function()end, 200, 20, "NewBuffTextBox", _, _, options_dropdown_template)
local new_debuff_entry = self:CreateTextEntry (f_manual, function()end, 200, 20, "NewDebuffTextBox", _, _, options_dropdown_template)
local new_buff_entry = self:CreateTextEntry(f_manual, function()end, 200, 20, "NewBuffTextBox", _, _, options_dropdown_template)
local new_debuff_entry = self:CreateTextEntry(f_manual, function()end, 200, 20, "NewDebuffTextBox", _, _, options_dropdown_template)
new_buff_entry:SetHook("OnEditFocusGained", load_all_spells)
new_debuff_entry:SetHook("OnEditFocusGained", load_all_spells)
@@ -1084,7 +1081,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
if (text ~= "") then
--check for more than one spellname
if (text:find (";")) then
if (text:find(";")) then
for _, spellName in ipairs({strsplit(";", text)}) do
spellName = self:trim (spellName)
local spellID = get_spellID_from_string (spellName)
@@ -1131,7 +1128,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
new_debuff_entry:ClearFocus()
if (text ~= "") then
--check for more than one spellname
if (text:find (";")) then
if (text:find(";")) then
for _, spellName in ipairs({strsplit(";", text)}) do
spellName = self:trim (spellName)
local spellID = get_spellID_from_string (spellName)
@@ -1177,7 +1174,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
multiple_spells_label:SetSize(350, 24)
multiple_spells_label:SetJustifyV ("top")
local export_box = self:CreateTextEntry (f_manual, function()end, 242, 20, "ExportAuraTextBox", _, _, options_dropdown_template)
local export_box = self:CreateTextEntry(f_manual, function()end, 242, 20, "ExportAuraTextBox", _, _, options_dropdown_template)
local export_buff_button = self:CreateButton(f_manual, function()
local str = ""
@@ -1188,7 +1185,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
end
end
export_box.text = str
export_box:SetFocus (true)
export_box:SetFocus(true)
export_box:HighlightText()
end, 120, 20, "Export Buffs", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -1203,7 +1200,7 @@ function DF:CreateAuraConfigPanel (parent, name, db, change_callback, options, t
end
export_box.text = str
export_box:SetFocus (true)
export_box:SetFocus(true)
export_box:HighlightText()
end, 120, 20, "Export Debuffs", nil, nil, nil, nil, nil, nil, DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
+93 -120
View File
@@ -6,16 +6,12 @@ if (not DF or not DetailsFrameworkCanLoad) then
end
local _
local cleanfunction = function() end
local emptyFunction = function() end
local APIButtonFunctions = false
do
local metaPrototype = {
WidgetType = "button",
SetHook = DF.SetHook,
HasHook = DF.HasHook,
ClearHooks = DF.ClearHooks,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion
}
@@ -41,6 +37,8 @@ local ButtonMetaFunctions = _G[DF.GlobalWidgetControlNames["button"]]
DF:Mixin(ButtonMetaFunctions, DF.SetPointMixin)
DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
DF:Mixin(ButtonMetaFunctions, DF.TooltipHandlerMixin)
DF:Mixin(ButtonMetaFunctions, DF.ScriptHookMixin)
------------------------------------------------------------------------------------------------------------
--metatables
@@ -123,7 +121,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
ButtonMetaFunctions.GetMembers["fontsize"] = gmember_textsize
ButtonMetaFunctions.GetMembers["textcolor"] = gmember_textcolor --alias
ButtonMetaFunctions.GetMembers["textfont"] = gmember_textfont --alias
ButtonMetaFunctions.GetMembers["textsize"] = gmember_textsize --alias
ButtonMetaFunctions.GetMembers["textsize"] = gmember_textsize --alias
ButtonMetaFunctions.__index = function(_table, _member_requested)
@@ -131,15 +129,15 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
if (func) then
return func (_table, _member_requested)
end
local fromMe = rawget (_table, _member_requested)
local fromMe = rawget(_table, _member_requested)
if (fromMe) then
return fromMe
end
return ButtonMetaFunctions [_member_requested]
end
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
--tooltip
@@ -198,7 +196,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
--text color
local smember_textcolor = function(_object, _value)
local _value1, _value2, _value3, _value4 = DF:ParseColors(_value)
return _object.button.text:SetTextColor (_value1, _value2, _value3, _value4)
return _object.button.text:SetTextColor(_value1, _value2, _value3, _value4)
end
--text font
@@ -261,7 +259,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
_object.capsule_textalign = "right"
end
end
ButtonMetaFunctions.SetMembers = ButtonMetaFunctions.SetMembers or {}
ButtonMetaFunctions.SetMembers ["tooltip"] = smember_tooltip
ButtonMetaFunctions.SetMembers ["show"] = smember_show
@@ -281,7 +279,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
ButtonMetaFunctions.SetMembers ["texture"] = smember_texture
ButtonMetaFunctions.SetMembers ["locked"] = smember_locked
ButtonMetaFunctions.SetMembers ["textalign"] = smember_textalign
ButtonMetaFunctions.__newindex = function(_table, _key, _value)
local func = ButtonMetaFunctions.SetMembers [_key]
if (func) then
@@ -294,26 +292,13 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
------------------------------------------------------------------------------------------------------------
--methods
--tooltip
function ButtonMetaFunctions:SetTooltip(tooltip)
if (tooltip) then
return rawset(self, "have_tooltip", tooltip)
else
return rawset(self, "have_tooltip", nil)
end
end
function ButtonMetaFunctions:GetTooltip()
return rawget(self, "have_tooltip")
end
--functions
function ButtonMetaFunctions:SetClickFunction(func, param1, param2, clickType)
if (not clickType or string.find(string.lower(clickType), "left")) then
if (func) then
rawset(self, "func", func)
else
rawset(self, "func", cleanfunction)
rawset(self, "func", emptyFunction)
end
if (param1 ~= nil) then
@@ -323,11 +308,11 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
rawset(self, "param2", param2)
end
elseif (clickType or string.find (string.lower (clickType), "right")) then
elseif (clickType or string.find(string.lower(clickType), "right")) then
if (func) then
rawset(self, "funcright", func)
else
rawset(self, "funcright", cleanfunction)
rawset(self, "funcright", emptyFunction)
end
end
end
@@ -521,7 +506,7 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
return
end
button.MyObject.is_mouse_over = true
object.is_mouse_over = true
if (button.texture) then
if (button.texture.coords) then
@@ -531,23 +516,15 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
end
end
if (button.MyObject.onenter_backdrop_border_color) then
button:SetBackdropBorderColor(unpack(button.MyObject.onenter_backdrop_border_color))
if (object.onenter_backdrop_border_color) then
button:SetBackdropBorderColor(unpack(object.onenter_backdrop_border_color))
end
if (button.MyObject.onenter_backdrop) then
button:SetBackdropColor(unpack(button.MyObject.onenter_backdrop))
if (object.onenter_backdrop) then
button:SetBackdropColor(unpack(object.onenter_backdrop))
end
if (button.MyObject.have_tooltip) then
GameCooltip2:Preset(2)
if (type(button.MyObject.have_tooltip) == "function") then
GameCooltip2:AddLine(button.MyObject.have_tooltip() or "")
else
GameCooltip2:AddLine(button.MyObject.have_tooltip)
end
GameCooltip2:ShowCooltip(button, "tooltip")
end
object:ShowTooltip()
end
local OnLeave = function(button)
@@ -558,9 +535,9 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
return
end
button.MyObject.is_mouse_over = false
object.is_mouse_over = false
if (button.texture and not button.MyObject.is_mouse_down) then
if (button.texture and not object.is_mouse_down) then
if (button.texture.coords) then
button.texture:SetTexCoord(unpack(button.texture.coords.Normal))
else
@@ -568,19 +545,15 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
end
end
if (button.MyObject.onleave_backdrop_border_color) then
button:SetBackdropBorderColor(unpack(button.MyObject.onleave_backdrop_border_color))
if (object.onleave_backdrop_border_color) then
button:SetBackdropBorderColor(unpack(object.onleave_backdrop_border_color))
end
if (button.MyObject.onleave_backdrop) then
button:SetBackdropColor(unpack(button.MyObject.onleave_backdrop))
if (object.onleave_backdrop) then
button:SetBackdropColor(unpack(object.onleave_backdrop))
end
if (button.MyObject.have_tooltip) then
if (GameCooltip2:GetText(1) == button.MyObject.have_tooltip or type(button.MyObject.have_tooltip) == "function") then
GameCooltip2:Hide()
end
end
object:HideTooltip()
end
local OnHide = function(button)
@@ -600,18 +573,18 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
end
local OnMouseDown = function(button, buttontype)
local object = button.MyObject
if (not button:IsEnabled()) then
return
end
local object = button.MyObject
local kill = object:RunHooksForWidget("OnMouseDown", button, object)
if (kill) then
return
end
button.MyObject.is_mouse_down = true
object.is_mouse_down = true
if (button.texture) then
if (button.texture.coords) then
@@ -621,22 +594,22 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
end
end
if (button.MyObject.capsule_textalign) then
if (button.MyObject.icon) then
button.MyObject.icon:SetPoint("left", button, "left", 5 + (button.MyObject.icon.leftpadding or 0), -1)
if (object.capsule_textalign) then
if (object.icon) then
object.icon:SetPoint("left", button, "left", 5 + (object.icon.leftpadding or 0), -1)
elseif (button.MyObject.capsule_textalign == "left") then
elseif (object.capsule_textalign == "left") then
button.text:SetPoint("left", button, "left", 3, -1)
elseif (button.MyObject.capsule_textalign == "center") then
elseif (object.capsule_textalign == "center") then
button.text:SetPoint("center", button, "center", 1, -1)
elseif (button.MyObject.capsule_textalign == "right") then
elseif (object.capsule_textalign == "right") then
button.text:SetPoint("right", button, "right", -1, -1)
end
else
if (button.MyObject.icon) then
button.MyObject.icon:SetPoint("left", button, "left", 5 + (button.MyObject.icon.leftpadding or 0), -1)
if (object.icon) then
object.icon:SetPoint("left", button, "left", 5 + (object.icon.leftpadding or 0), -1)
else
button.text:SetPoint("center", button,"center", 1, -1)
end
@@ -647,19 +620,19 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
button.x = floor(x)
button.y = floor(y)
if (not button.MyObject.container.isLocked and button.MyObject.container:IsMovable()) then
if (not object.container.isLocked and object.container:IsMovable()) then
if (not button.isLocked and button:IsMovable()) then
button.MyObject.container.isMoving = true
button.MyObject.container:StartMoving()
object.container.isMoving = true
object.container:StartMoving()
end
end
if (button.MyObject.options.OnGrab) then
if (type(button.MyObject.options.OnGrab) == "string" and button.MyObject.options.OnGrab == "PassClick") then
if (object.options.OnGrab) then
if (type(object.options.OnGrab) == "string" and object.options.OnGrab == "PassClick") then
if (buttontype == "LeftButton") then
DF:CoreDispatch((button:GetName() or "Button") .. ":OnMouseDown()", button.MyObject.func, button, buttontype, button.MyObject.param1, button.MyObject.param2)
DF:CoreDispatch((button:GetName() or "Button") .. ":OnMouseDown()", object.func, button, buttontype, object.param1, object.param2)
else
DF:CoreDispatch((button:GetName() or "Button") .. ":OnMouseDown()", button.MyObject.funcright, button, buttontype, button.MyObject.param1, button.MyObject.param2)
DF:CoreDispatch((button:GetName() or "Button") .. ":OnMouseDown()", object.funcright, button, buttontype, object.param1, object.param2)
end
end
end
@@ -671,22 +644,23 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
end
local object = button.MyObject
local kill = object:RunHooksForWidget("OnMouseUp", button, object)
if (kill) then
return
end
button.MyObject.is_mouse_down = false
object.is_mouse_down = false
if (button.texture) then
if (button.texture.coords) then
if (button.MyObject.is_mouse_over) then
if (object.is_mouse_over) then
button.texture:SetTexCoord(unpack(button.texture.coords.Highlight))
else
button.texture:SetTexCoord(unpack(coords.Normal))
end
else
if (button.MyObject.is_mouse_over) then
if (object.is_mouse_over) then
button.texture:SetTexCoord(0, 1, 0.24609375, 0.49609375)
else
button.texture:SetTexCoord(0, 1, 0, 0.24609375)
@@ -694,30 +668,30 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
end
end
if (button.MyObject.capsule_textalign) then
if (button.MyObject.icon) then
button.MyObject.icon:SetPoint("left", button, "left", 4 + (button.MyObject.icon.leftpadding or 0), 0)
if (object.capsule_textalign) then
if (object.icon) then
object.icon:SetPoint("left", button, "left", 4 + (object.icon.leftpadding or 0), 0)
elseif (button.MyObject.capsule_textalign == "left") then
elseif (object.capsule_textalign == "left") then
button.text:SetPoint("left", button, "left", 2, 0)
elseif (button.MyObject.capsule_textalign == "center") then
elseif (object.capsule_textalign == "center") then
button.text:SetPoint("center", button, "center", 0, 0)
elseif (button.MyObject.capsule_textalign == "right") then
elseif (object.capsule_textalign == "right") then
button.text:SetPoint("right", button, "right", -2, 0)
end
else
if (button.MyObject.icon) then
button.MyObject.icon:SetPoint("left", button, "left", 4 + (button.MyObject.icon.leftpadding or 0), 0)
if (object.icon) then
object.icon:SetPoint("left", button, "left", 4 + (object.icon.leftpadding or 0), 0)
else
button.text:SetPoint("center", button,"center", 0, 0)
end
end
if (button.MyObject.container.isMoving) then
button.MyObject.container:StopMovingOrSizing()
button.MyObject.container.isMoving = false
if (object.container.isMoving) then
object.container:StopMovingOrSizing()
object.container.isMoving = false
end
local x, y = GetCursorPosition()
@@ -728,9 +702,9 @@ DF:Mixin(ButtonMetaFunctions, DF.FrameMixin)
if ((x == button.x and y == button.y) or (button.mouse_down + 0.5 > GetTime() and button:IsMouseOver())) then
if (buttonType == "LeftButton") then
DF:CoreDispatch((button:GetName() or "Button") .. ":OnMouseUp()", button.MyObject.func, button, buttonType, button.MyObject.param1, button.MyObject.param2)
DF:CoreDispatch((button:GetName() or "Button") .. ":OnMouseUp()", object.func, button, buttonType, object.param1, object.param2)
else
DF:CoreDispatch((button:GetName() or "Button") .. ":OnMouseUp()", button.MyObject.funcright, button, buttonType, button.MyObject.param1, button.MyObject.param2)
DF:CoreDispatch((button:GetName() or "Button") .. ":OnMouseUp()", object.funcright, button, buttonType, object.param1, object.param2)
end
end
end
@@ -792,8 +766,8 @@ function ButtonMetaFunctions:SetTemplate(template)
end
if (template.icon) then
local i = template.icon
self:SetIcon(i.texture, i.width, i.height, i.layout, i.texcoord, i.color, i.textdistance, i.leftpadding)
local iconInfo = template.icon
self:SetIcon(iconInfo.texture, iconInfo.width, iconInfo.height, iconInfo.layout, iconInfo.texcoord, iconInfo.color, iconInfo.textdistance, iconInfo.leftpadding)
end
if (template.textsize) then
@@ -815,7 +789,6 @@ end
------------------------------------------------------------------------------------------------------------
--object constructor
local onDisableFunc = function(self)
self.texture_disabled:Show()
self.texture_disabled:SetVertexColor(0, 0, 0)
@@ -830,10 +803,10 @@ end
self:SetSize(100, 20)
self.text = self:CreateFontString("$parent_Text", "ARTWORK", "GameFontNormal")
self:SetFontString(self.text)
self.text:SetJustifyH("CENTER")
DF:SetFontSize(self.text, 10)
self.text:SetPoint("CENTER", self, "CENTER", 0, 0)
self:SetFontString(self.text)
DF:SetFontSize(self.text, 10)
self.texture_disabled = self:CreateTexture("$parent_TextureDisabled", "OVERLAY")
self.texture_disabled:SetAllPoints()
@@ -883,10 +856,9 @@ end
DF:Mixin(buttonObject.button, DF.WidgetFunctions)
createButtonWidgets(buttonObject.button)
buttonObject.button:SetSize(width or 100, height or 20)
buttonObject.widget = buttonObject.button
buttonObject.button:SetBackdropColor(0, 0, 0, 0.4)
buttonObject.button:SetBackdropBorderColor(1, 1, 1, 1)
buttonObject.button.MyObject = buttonObject
if (not APIButtonFunctions) then
APIButtonFunctions = true
@@ -901,10 +873,6 @@ end
end
end
buttonObject.button:SetWidth(width or 100)
buttonObject.button:SetHeight(height or 20)
buttonObject.button.MyObject = buttonObject
buttonObject.text_overlay = _G[name .. "_Text"]
buttonObject.disabled_overlay = _G[name .. "_TextureDisabled"]
@@ -914,7 +882,9 @@ end
buttonObject.button:SetDisabledTexture(texture)
buttonObject.button:SetHighlightTexture(texture, "ADD")
buttonObject.button.text:SetText(text or "")
local locTable = text
DF.Language.SetTextWithLocTableWithDefault(buttonObject.button.text, locTable, text)
buttonObject.button.text:SetPoint("center", buttonObject.button, "center")
local textWidth = buttonObject.button.text:GetStringWidth()
@@ -943,8 +913,8 @@ end
end
end
buttonObject.func = func or cleanfunction
buttonObject.funcright = cleanfunction
buttonObject.func = func or emptyFunction
buttonObject.funcright = emptyFunction
buttonObject.param1 = param1
buttonObject.param2 = param2
buttonObject.short_method = shortMethod
@@ -953,10 +923,12 @@ end
if (textTemplate.size) then
DF:SetFontSize(buttonObject.button.text, textTemplate.size)
end
if (textTemplate.color) then
local r, g, b, a = DF:ParseColors(textTemplate.color)
buttonObject.button.text:SetTextColor(r, g, b, a)
end
if (textTemplate.font) then
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
local font = SharedMedia:Fetch("font", textTemplate.font)
@@ -1027,31 +999,32 @@ end
function DF:NewColorPickButton(parent, name, member, callback, alpha, buttonTemplate)
--button
local button = DF:NewButton(parent, _, name, member, 16, 16, pickcolor, alpha, "param2", nil, nil, nil, buttonTemplate)
button.color_callback = callback
button.Cancel = colorpickCancel
button.SetColor = setColorPickColor
button.GetColor = getColorPickColor
local colorPickButton = DF:NewButton(parent, _, name, member, 16, 16, pickcolor, alpha, "param2", nil, nil, nil, buttonTemplate)
colorPickButton.color_callback = callback
colorPickButton.Cancel = colorpickCancel
colorPickButton.SetColor = setColorPickColor
colorPickButton.GetColor = getColorPickColor
button.HookList.OnColorChanged = {}
colorPickButton.HookList.OnColorChanged = {}
if (not buttonTemplate) then
button:InstallCustomTexture()
colorPickButton:SetTemplate(DF:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
end
local background = button:CreateTexture(nil, "background", nil, 2)
background:SetPoint("topleft", button.widget, "topleft", 0, 0)
background:SetPoint("bottomright", button.widget, "bottomright", 0, 0)
--background showing a grid to indicate the transparency
local background = colorPickButton:CreateTexture(nil, "background", nil, 2)
background:SetPoint("topleft", colorPickButton.widget, "topleft", 0, 0)
background:SetPoint("bottomright", colorPickButton.widget, "bottomright", 0, 0)
background:SetTexture([[Interface\ITEMSOCKETINGFRAME\UI-EMPTYSOCKET]])
background:SetTexCoord(3/16, 13/16, 3/16, 13/16)
background:SetAlpha(0.3)
--color texture
local img = DF:NewImage(button, nil, 16, 16, nil, nil, "color_texture", "$parentTex")
img:SetColorTexture(1, 1, 1)
img:SetPoint("topleft", button.widget, "topleft", 0, 0)
img:SetPoint("bottomright", button.widget, "bottomright", 0, 0)
img:SetDrawLayer("background", 3)
--texture which shows the texture color
local colorTexture = DF:NewImage(colorPickButton, nil, 16, 16, nil, nil, "color_texture", "$parentTex")
colorTexture:SetColorTexture(1, 1, 1)
colorTexture:SetPoint("topleft", colorPickButton.widget, "topleft", 0, 0)
colorTexture:SetPoint("bottomright", colorPickButton.widget, "bottomright", 0, 0)
colorTexture:SetDrawLayer("background", 3)
return button
return colorPickButton
end
+9 -4
View File
@@ -15,7 +15,7 @@ local max = math.max
--api locals
local PixelUtil = PixelUtil or DFPixelUtil
local version = 4
local version = 5
local CONST_MENU_TYPE_MAINMENU = "main"
local CONST_MENU_TYPE_SUBMENU = "sub"
@@ -1142,7 +1142,7 @@ function DF:CreateCoolTip()
function gameCooltip:StatusBar(menuButton, statusBarSettings)
if (statusBarSettings) then
menuButton.statusbar:SetValue(statusBarSettings[1])
menuButton.statusbar:SetStatusBarColor (statusBarSettings[2], statusBarSettings[3], statusBarSettings[4], statusBarSettings[5])
menuButton.statusbar:SetStatusBarColor(statusBarSettings[2], statusBarSettings[3], statusBarSettings[4], statusBarSettings[5])
menuButton.statusbar:SetHeight(20 + (gameCooltip.OptionsTable.StatusBarHeightMod or 0))
menuButton.spark2:Hide()
@@ -1160,9 +1160,9 @@ function DF:CreateCoolTip()
end
if (statusBarSettings[7].color) then
local colorRed, colorGreen, colorBlue, colorAlpha = DF:ParseColors(statusBarSettings[7].color)
menuButton.statusbar2:SetStatusBarColor (colorRed, colorGreen, colorBlue, colorAlpha)
menuButton.statusbar2:SetStatusBarColor(colorRed, colorGreen, colorBlue, colorAlpha)
else
menuButton.statusbar2:SetStatusBarColor (1, 1, 1, 1)
menuButton.statusbar2:SetStatusBarColor(1, 1, 1, 1)
end
else
menuButton.statusbar2:SetValue(0)
@@ -1961,6 +1961,11 @@ function DF:CreateCoolTip()
return gameCooltip.Host
end
function gameCooltip:IsOwner(frame)
local currentOwner = gameCooltip:GetOwner()
return currentOwner == frame
end
--set the anchor of cooltip, parameters: frame [, cooltip anchor point, frame anchor point[, x mod, y mod]]
function gameCooltip:SetOwner(frame, myPoint, hisPoint, x, y)
return gameCooltip:SetHost(frame, myPoint, hisPoint, x, y)
+63 -66
View File
@@ -10,10 +10,6 @@ local loadedAPIDropDownFunctions = false
do
local metaPrototype = {
WidgetType = "dropdown",
SetHook = DF.SetHook,
HasHook = DF.HasHook,
ClearHooks = DF.ClearHooks,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
@@ -39,49 +35,58 @@ local DropDownMetaFunctions = _G[DF.GlobalWidgetControlNames["dropdown"]]
DF:Mixin(DropDownMetaFunctions, DF.SetPointMixin)
DF:Mixin(DropDownMetaFunctions, DF.FrameMixin)
DF:Mixin(DropDownMetaFunctions, DF.TooltipHandlerMixin)
DF:Mixin(DropDownMetaFunctions, DF.ScriptHookMixin)
------------------------------------------------------------------------------------------------------------
--metatables
DropDownMetaFunctions.__call = function(_table, value)
DropDownMetaFunctions.__call = function(object, value)
--unknown
end
------------------------------------------------------------------------------------------------------------
--members
--selected value
local gmember_value = function(object)
return object:GetValue()
end
--tooltip
local gmember_tooltip = function(object)
return object:GetTooltip()
end
--shown
local gmember_shown = function(object)
return object:IsShown()
end
--frame width
local gmember_width = function(object)
return object.button:GetWidth()
end
--frame height
local gmember_height = function(object)
return object.button:GetHeight()
end
--current text
local gmember_text = function(object)
return object.label:GetText()
end
--menu creation function
local gmember_function = function(object)
return object:GetFunction()
end
--menu width
local gmember_menuwidth = function(object)
return rawget(object, "realsizeW")
end
--menu height
local gmember_menuheight = function(object)
return rawget(object, "realsizeH")
@@ -118,6 +123,7 @@ DF:Mixin(DropDownMetaFunctions, DF.FrameMixin)
local smember_tooltip = function(object, value)
return object:SetTooltip(value)
end
--show
local smember_show = function(object, value)
if (value) then
@@ -126,6 +132,7 @@ DF:Mixin(DropDownMetaFunctions, DF.FrameMixin)
return object:Hide()
end
end
--hide
local smember_hide = function(object, value)
if (not value) then
@@ -134,36 +141,41 @@ DF:Mixin(DropDownMetaFunctions, DF.FrameMixin)
return object:Hide()
end
end
--frame width
local smember_width = function(object, value)
return object.dropdown:SetWidth(value)
end
--frame height
local smember_height = function(object, value)
return object.dropdown:SetHeight(value)
end
end
--menu creation function
local smember_function = function(object, value)
return object:SetFunction(value)
end
--menu width
local smember_menuwidth = function(object, value)
object:SetMenuSize(value, nil)
end
--menu height
local smember_menuheight = function(object, value)
object:SetMenuSize(nil, value)
end
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.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(object, key, value)
local func = DropDownMetaFunctions.SetMembers[key]
@@ -185,6 +197,7 @@ DF:Mixin(DropDownMetaFunctions, DF.FrameMixin)
return rawset(self, "realsizeH", height)
end
end
function DropDownMetaFunctions:GetMenuSize()
return rawget(self, "realsizeW"), rawget(self, "realsizeH")
end
@@ -193,6 +206,7 @@ DF:Mixin(DropDownMetaFunctions, DF.FrameMixin)
function DropDownMetaFunctions:SetFunction(func)
return rawset(self, "func", func)
end
function DropDownMetaFunctions:GetFunction()
return rawget(self, "func")
end
@@ -201,22 +215,11 @@ DF:Mixin(DropDownMetaFunctions, DF.FrameMixin)
function DropDownMetaFunctions:GetValue()
return rawget(self, "myvalue")
end
function DropDownMetaFunctions:SetValue(value)
return rawset(self, "myvalue", value)
end
--tooltip
function DropDownMetaFunctions:SetTooltip(tooltip)
if (tooltip) then
return rawset(self, "have_tooltip", tooltip)
else
return rawset(self, "have_tooltip", nil)
end
end
function DropDownMetaFunctions:GetTooltip()
return rawget(self, "have_tooltip")
end
--frame levels
function DropDownMetaFunctions:SetFrameLevel(level, frame)
if (not frame) then
@@ -362,7 +365,7 @@ local runCallbackFunctionForButton = function(button)
--need: the the callback func, the object of the dropdown (capsule), the object (capsule) of the button to get FixedValue and the last need the value of the optionTable
local success, errorText = pcall(button.table.onclick, button:GetParent():GetParent():GetParent().MyObject, button.object.FixedValue, button.table.value)
if (not success) then
error ("Details! Framework: dropdown " .. button:GetParent():GetParent():GetParent().MyObject:GetName() .. " error: " .. errorText)
error("Details! Framework: dropdown " .. button:GetParent():GetParent():GetParent().MyObject:GetName() .. " error: " .. errorText)
end
button:GetParent():GetParent():GetParent().MyObject:RunHooksForWidget("OnOptionSelected", button:GetParent():GetParent():GetParent().MyObject, button.object.FixedValue, button.table.value)
end
@@ -374,7 +377,7 @@ local canRunCallbackFunctionForOption = function(canRunCallback, optionTable, dr
if (optionTable.onclick) then
local success, errorText = pcall(optionTable.onclick, dropdownObject, fixedValue, optionTable.value)
if (not success) then
error ("Details! Framework: dropdown " .. dropdownObject:GetName() .. " error: " .. errorText)
error("Details! Framework: dropdown " .. dropdownObject:GetName() .. " error: " .. errorText)
end
dropdownObject:RunHooksForWidget("OnOptionSelected", dropdownObject, fixedValue, optionTable.value)
end
@@ -433,6 +436,7 @@ function DropDownMetaFunctions:Select(optionName, byOptionNumber, onlyShown, run
self:Selected(optionTableSelected)
canRunCallbackFunctionForOption(runCallback, optionTableSelected, self)
return true
else
local optionTableSelected = optionsTable[optionIndex]
@@ -823,90 +827,82 @@ function DetailsFrameworkDropDownOnMouseDown(button, buttontype)
end
function DetailsFrameworkDropDownOnEnter(self)
local capsule = self.MyObject
local kill = capsule:RunHooksForWidget("OnEnter", self, capsule)
local object = self.MyObject
local kill = object:RunHooksForWidget("OnEnter", self, object)
if (kill) then
return
end
if (self.MyObject.onenter_backdrop) then
self:SetBackdropColor(unpack(self.MyObject.onenter_backdrop))
if (object.onenter_backdrop) then
self:SetBackdropColor(unpack(object.onenter_backdrop))
else
self:SetBackdropColor(.2, .2, .2, .2)
end
if (self.MyObject.onenter_backdrop_border_color) then
self:SetBackdropBorderColor(unpack(self.MyObject.onenter_backdrop_border_color))
if (object.onenter_backdrop_border_color) then
self:SetBackdropBorderColor(unpack(object.onenter_backdrop_border_color))
end
self.arrowTexture2:Show()
if (self.MyObject.have_tooltip) then
GameCooltip2:Preset(2)
if (type(self.MyObject.have_tooltip) == "function") then
GameCooltip2:AddLine(self.MyObject.have_tooltip() or "")
else
GameCooltip2:AddLine(self.MyObject.have_tooltip)
end
GameCooltip2:SetOwner(self)
GameCooltip2:ShowCooltip()
end
object:ShowTooltip()
end
function DetailsFrameworkDropDownOnLeave(self)
local capsule = self.MyObject
local kill = capsule:RunHooksForWidget("OnLeave", self, capsule)
local object = self.MyObject
local kill = object:RunHooksForWidget("OnLeave", self, object)
if (kill) then
return
end
if (self.MyObject.onleave_backdrop) then
self:SetBackdropColor(unpack(self.MyObject.onleave_backdrop))
if (object.onleave_backdrop) then
self:SetBackdropColor(unpack(object.onleave_backdrop))
else
self:SetBackdropColor(1, 1, 1, .5)
end
if (self.MyObject.onleave_backdrop_border_color) then
self:SetBackdropBorderColor(unpack(self.MyObject.onleave_backdrop_border_color))
if (object.onleave_backdrop_border_color) then
self:SetBackdropBorderColor(unpack(object.onleave_backdrop_border_color))
end
self.arrowTexture2:Hide()
if (self.MyObject.have_tooltip) then
GameCooltip2:ShowMe(false)
end
object:HideTooltip()
end
function DetailsFrameworkDropDownOnSizeChanged(self)
self.MyObject.label:SetSize(self:GetWidth()-40, 10)
local object = self.MyObject
object.label:SetSize(self:GetWidth() - 40, 10)
end
function DetailsFrameworkDropDownOnShow(self)
local capsule = self.MyObject
local kill = capsule:RunHooksForWidget("OnShow", self, capsule)
local object = self.MyObject
local kill = object:RunHooksForWidget("OnShow", self, object)
if (kill) then
return
end
end
function DetailsFrameworkDropDownOnHide(self)
local capsule = self.MyObject
local kill = capsule:RunHooksForWidget("OnHide", self, capsule)
local object = self.MyObject
local kill = object:RunHooksForWidget("OnHide", self, object)
if (kill) then
return
end
self.MyObject:Close()
object:Close()
end
function DF:BuildDropDownFontList(onClick, icon, iconTexcoord, iconSize)
local t = {}
local fontTable = {}
local SharedMedia = LibStub:GetLibrary("LibSharedMedia-3.0")
for name, fontPath in pairs(SharedMedia:HashTable("font")) do
t[#t+1] = {value = name, label = name, onclick = onClick, icon = icon, iconsize = iconSize, texcoord = iconTexcoord, font = fontPath, descfont = "abcdefg ABCDEFG"}
fontTable[#fontTable+1] = {value = name, label = name, onclick = onClick, icon = icon, iconsize = iconSize, texcoord = iconTexcoord, font = fontPath, descfont = "abcdefg ABCDEFG"}
end
table.sort(t, function(t1, t2) return t1.label < t2.label end)
return t
table.sort(fontTable, function(t1, t2) return t1.label < t2.label end)
return fontTable
end
------------------------------------------------------------------------------------------------------------
@@ -1104,6 +1100,7 @@ function DF:NewDropDown(parent, container, name, member, width, height, func, de
--initialize first menu selected
if (type(default) == "string") then
dropDownObject:Select(default)
elseif (type(default) == "number") then
if (not dropDownObject:Select(default)) then
dropDownObject:Select(default, true)
@@ -1117,7 +1114,7 @@ function DF:NewDropDown(parent, container, name, member, width, height, func, de
return dropDownObject
end
local defaultBackdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
local defaultBackdrop = {bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]], edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
edgeSize = 1, tile = true, tileSize = 16, insets = {left = 1, right = 1, top = 0, bottom = 1}}
local borderBackdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 0, right = 0, top = 0, bottom = 0}}
local childBackdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 256, insets = {left = 0, right = 0, top = 0, bottom = 0}}
+141 -189
View File
@@ -1,6 +1,6 @@
local dversion = 379
local dversion = 380
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)
@@ -179,7 +179,7 @@ function DF:GetRoleByClassicTalentTree()
--get the spec with more points spent
local spec = pointsPerSpec[1]
if (spec and spec [2] >= MIN_SPECS) then
if (spec and spec[2] >= MIN_SPECS) then
local specName = spec[1]
local spentPoints = spec[2]
local specTexture = spec[3]
@@ -337,7 +337,6 @@ local embedFunctions = {
"BuildMenu",
"ShowTutorialAlertFrame",
"GetNpcIdFromGuid",
"ShowFeedbackPanel",
"SetAsOptionsPanel",
"GetPlayerRole",
"GetCharacterTalents",
@@ -361,7 +360,6 @@ local embedFunctions = {
"CreateSplitBar",
"CreateTextEntry",
"Create1PxPanel",
"CreateFeedbackButton",
"CreateOptionsFrame",
"NewSpecialLuaEditorEntry",
"ShowPromptPanel",
@@ -676,7 +674,7 @@ function DF:CommaValue(value)
--source http://richard.warburton.it
local left, num, right = string_match (value, '^([^%d]*%d)(%d*)(.-)$')
return left .. (num:reverse():gsub ('(%d%d%d)','%1,'):reverse()) .. right
return left .. (num:reverse():gsub('(%d%d%d)','%1,'):reverse()) .. right
end
function DF:GroupIterator(callback, ...)
@@ -724,7 +722,7 @@ function DF:SetFontFace(fontString, fontface)
end
function DF:SetFontColor(fontString, r, g, b, a)
r, g, b, a = DF:ParseColors(r, g, b, a)
fontString:SetTextColor (r, g, b, a)
fontString:SetTextColor(r, g, b, a)
end
function DF:SetFontShadow (fontString, r, g, b, a, x, y)
@@ -2388,11 +2386,11 @@ end
function DF:CreateInCombatTexture(frame)
if (DF.debug and not frame) then
error ("Details! Framework: CreateInCombatTexture invalid frame on parameter 1.")
error("Details! Framework: CreateInCombatTexture invalid frame on parameter 1.")
end
local in_combat_background = DF:CreateImage(frame)
in_combat_background:SetColorTexture (.6, 0, 0, .1)
in_combat_background:SetColorTexture(.6, 0, 0, .1)
in_combat_background:Hide()
local in_combat_label = Plater:CreateLabel(frame, "you are in combat", 24, "silver")
@@ -2589,15 +2587,15 @@ end
local texturetitle = options_frame:CreateTexture(nil, "artwork")
texturetitle:SetTexture([[Interface\CURSOR\Interact]])
texturetitle:SetTexCoord (0, 1, 0, 1)
texturetitle:SetTexCoord(0, 1, 0, 1)
texturetitle:SetVertexColor(1, 1, 1, 1)
texturetitle:SetPoint("topleft", options_frame, "topleft", 2, -3)
texturetitle:SetWidth(36)
texturetitle:SetHeight(36)
local title = DF:NewLabel(options_frame, nil, "$parentTitle", nil, title, nil, 20, "yellow")
title:SetPoint("left", texturetitle, "right", 2, -1)
DF:SetFontOutline (title, true)
local titleLabel = DF:NewLabel(options_frame, nil, "$parentTitle", nil, title, nil, 20, "yellow")
titleLabel:SetPoint("left", texturetitle, "right", 2, -1)
DF:SetFontOutline (titleLabel, true)
local c = CreateFrame("Button", nil, options_frame, "UIPanelCloseButton")
c:SetWidth(32)
@@ -2612,6 +2610,12 @@ end
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--~templates
local latinLanguageIds = {"enUS", "deDE", "esES", "esMX", "frFR", "itIT", "ptBR"}
local alphbets = {
[latinLanguageIds] = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"},
["zhCN"] = {},
}
--fonts
DF.font_templates = DF.font_templates or {}
@@ -2634,8 +2638,37 @@ function DF:GetClientRegion()
end
end
DF.registeredFontPaths = DF.registeredFontPaths or {}
function DF:GetBestFontPathForLanguage(locale)
local fontPath = DF.registeredFontPaths[locale]
if (fontPath) then
return fontPath
end
--font paths gotten from creating a FontString with template "GameFontNormal" and getting the font returned from FontString:GetFont()
if (locale == "enUS" or locale == "deDE" or locale == "esES" or locale == "esMX" or locale == "frFR" or locale == "itIT" or locale == "ptBR") then
return [[Fonts\FRIZQT__.TTF]]
elseif (locale == "ruRU") then
return [[Fonts\FRIZQT___CYR.TTF]]
elseif (locale == "zhCN") then
return [[Fonts\ARKai_T.ttf]]
elseif (locale == "zhTW") then
return [[Fonts\blei00d.TTF]]
elseif (locale == "koKR") then
return [[Fonts\2002.TTF]]
end
--the locale passed doesn't exists, so pass the enUS
return [[Fonts\FRIZQT__.TTF]]
end
--return the best font to use for the client language
function DF:GetBestFontForLanguage (language, western, cyrillic, china, korean, taiwan)
function DF:GetBestFontForLanguage(language, western, cyrillic, china, korean, taiwan)
if (not language) then
language = DF.ClientLanguage
end
@@ -2644,7 +2677,7 @@ function DF:GetBestFontForLanguage (language, western, cyrillic, china, korean,
return western or "Friz Quadrata TT"
elseif (language == "ruRU") then
return cyrillic or "Arial Narrow"
return cyrillic or "Friz Quadrata TT"
elseif (language == "zhCN") then
return china or "AR CrystalzcuheiGBK Demibold"
@@ -2792,7 +2825,7 @@ function DF:InstallTemplate (widgetType, templateName, template, parentName)
end
function DF:GetTemplate(widget_type, template_name)
widget_type = string.lower (widget_type)
widget_type = string.lower(widget_type)
local template_table
if (widget_type == "font") then
@@ -2809,80 +2842,14 @@ function DF:GetTemplate(widget_type, template_name)
return template_table [template_name]
end
function DF.GetParentName (frame)
function DF.GetParentName(frame)
local parentName = frame:GetName()
if (not parentName) then
error ("Details! FrameWork: called $parent but parent was no name.", 2)
error("Details! FrameWork: called $parent but parent was no name.", 2)
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(), "no hooks for", 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
print(debugstack())
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
function DF:HasHook (hookType, func)
if (self.HookList [hookType]) then
if (type(func) == "function") then
for i = #self.HookList [hookType], 1, -1 do
if (self.HookList [hookType] [i] == func) then
return true
end
end
end
end
end
function DF:ClearHooks()
for hookType, hookTable in pairs(self.HookList) do
table.wipe(hookTable)
end
end
function DF:Error (errortext)
print("|cFFFF2222Details! Framework Error|r:", errortext, self.GetName and self:GetName(), self.WidgetType, debugstack (2, 3, 0))
end
@@ -2918,17 +2885,17 @@ function DF:AddMemberForWidget (widgetName, memberType, memberName, func)
end
else
if (DF.debug) then
error ("Details! Framework: AddMemberForWidget invalid function.")
error("Details! Framework: AddMemberForWidget invalid function.")
end
end
else
if (DF.debug) then
error ("Details! Framework: AddMemberForWidget unknown memberName or memberType.")
error("Details! Framework: AddMemberForWidget unknown memberName or memberType.")
end
end
else
if (DF.debug) then
error ("Details! Framework: AddMemberForWidget unknown widget type: " .. (widgetName or "") .. ".")
error("Details! Framework: AddMemberForWidget unknown widget type: " .. (widgetName or "") .. ".")
end
end
end
@@ -2975,11 +2942,11 @@ function DF:OpenInterfaceProfile()
if (text == self.__name) then
local toggle = _G ["InterfaceOptionsFrameAddOnsButton" .. i .. "Toggle"]
if (toggle) then
if (toggle:GetNormalTexture():GetTexture():find ("PlusButton")) 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
elseif (toggle:GetNormalTexture():GetTexture():find("MinusButton")) then
--isn't minimized
_G ["InterfaceOptionsFrameAddOnsButton" .. i+1]:Click()
end
@@ -3512,13 +3479,13 @@ end
local SetBorderColor = function(self, r, g, b)
for _, texture in ipairs(self.Borders.Layer1) do
texture:SetColorTexture (r, g, b)
texture:SetColorTexture(r, g, b)
end
for _, texture in ipairs(self.Borders.Layer2) do
texture:SetColorTexture (r, g, b)
texture:SetColorTexture(r, g, b)
end
for _, texture in ipairs(self.Borders.Layer3) do
texture:SetColorTexture (r, g, b)
texture:SetColorTexture(r, g, b)
end
end
@@ -3554,68 +3521,68 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3)
parent.SetLayerVisibility = SetLayerVisibility
local border1 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border1, "topleft", parent, "topleft", -1, 1)
PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", -1, -1)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetPoint(border1, "topleft", parent, "topleft", -1, 1)
PixelUtil.SetPoint(border1, "bottomleft", parent, "bottomleft", -1, -1)
border1:SetColorTexture(0, 0, 0, alpha1 or default_border_color1)
local border2 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -2, 2)
PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -2, -2)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetPoint(border2, "topleft", parent, "topleft", -2, 2)
PixelUtil.SetPoint(border2, "bottomleft", parent, "bottomleft", -2, -2)
border2:SetColorTexture(0, 0, 0, alpha2 or default_border_color2)
local border3 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -3, 3)
PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -3, -3)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetPoint(border3, "topleft", parent, "topleft", -3, 3)
PixelUtil.SetPoint(border3, "bottomleft", parent, "bottomleft", -3, -3)
border3:SetColorTexture(0, 0, 0, alpha3 or default_border_color3)
tinsert(parent.Borders.Layer1, border1)
tinsert(parent.Borders.Layer2, border2)
tinsert(parent.Borders.Layer3, border3)
local border1 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border1, "topleft", parent, "topleft", 0, 1)
PixelUtil.SetPoint (border1, "topright", parent, "topright", 1, 1)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetPoint(border1, "topleft", parent, "topleft", 0, 1)
PixelUtil.SetPoint(border1, "topright", parent, "topright", 1, 1)
border1:SetColorTexture(0, 0, 0, alpha1 or default_border_color1)
local border2 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -1, 2)
PixelUtil.SetPoint (border2, "topright", parent, "topright", 2, 2)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetPoint(border2, "topleft", parent, "topleft", -1, 2)
PixelUtil.SetPoint(border2, "topright", parent, "topright", 2, 2)
border2:SetColorTexture(0, 0, 0, alpha2 or default_border_color2)
local border3 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -2, 3)
PixelUtil.SetPoint (border3, "topright", parent, "topright", 3, 3)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetPoint(border3, "topleft", parent, "topleft", -2, 3)
PixelUtil.SetPoint(border3, "topright", parent, "topright", 3, 3)
border3:SetColorTexture(0, 0, 0, alpha3 or default_border_color3)
tinsert(parent.Borders.Layer1, border1)
tinsert(parent.Borders.Layer2, border2)
tinsert(parent.Borders.Layer3, border3)
local border1 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border1, "topright", parent, "topright", 1, 0)
PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 1, -1)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetPoint(border1, "topright", parent, "topright", 1, 0)
PixelUtil.SetPoint(border1, "bottomright", parent, "bottomright", 1, -1)
border1:SetColorTexture(0, 0, 0, alpha1 or default_border_color1)
local border2 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border2, "topright", parent, "topright", 2, 1)
PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 2, -2)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetPoint(border2, "topright", parent, "topright", 2, 1)
PixelUtil.SetPoint(border2, "bottomright", parent, "bottomright", 2, -2)
border2:SetColorTexture(0, 0, 0, alpha2 or default_border_color2)
local border3 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border3, "topright", parent, "topright", 3, 2)
PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 3, -3)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetPoint(border3, "topright", parent, "topright", 3, 2)
PixelUtil.SetPoint(border3, "bottomright", parent, "bottomright", 3, -3)
border3:SetColorTexture(0, 0, 0, alpha3 or default_border_color3)
tinsert(parent.Borders.Layer1, border1)
tinsert(parent.Borders.Layer2, border2)
tinsert(parent.Borders.Layer3, border3)
local border1 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", 0, -1)
PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 0, -1)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetPoint(border1, "bottomleft", parent, "bottomleft", 0, -1)
PixelUtil.SetPoint(border1, "bottomright", parent, "bottomright", 0, -1)
border1:SetColorTexture(0, 0, 0, alpha1 or default_border_color1)
local border2 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -1, -2)
PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 1, -2)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetPoint(border2, "bottomleft", parent, "bottomleft", -1, -2)
PixelUtil.SetPoint(border2, "bottomright", parent, "bottomright", 1, -2)
border2:SetColorTexture(0, 0, 0, alpha2 or default_border_color2)
local border3 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -2, -3)
PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 2, -3)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetPoint(border3, "bottomleft", parent, "bottomleft", -2, -3)
PixelUtil.SetPoint(border3, "bottomright", parent, "bottomright", 2, -3)
border3:SetColorTexture(0, 0, 0, alpha3 or default_border_color3)
tinsert(parent.Borders.Layer1, border1)
tinsert(parent.Borders.Layer2, border2)
@@ -3743,21 +3710,21 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread
--left
local border1 = parent:CreateTexture(nil, "background")
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetPoint (border1, "topleft", parent, "topleft", -1 + spread, 1 + (-spread), 0, 0)
PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", -1 + spread, -1 + spread, 0, 0)
border1:SetColorTexture(0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetPoint(border1, "topleft", parent, "topleft", -1 + spread, 1 + (-spread), 0, 0)
PixelUtil.SetPoint(border1, "bottomleft", parent, "bottomleft", -1 + spread, -1 + spread, 0, 0)
PixelUtil.SetWidth (border1, size, minPixels)
local border2 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -2 + spread, 2 + (-spread))
PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -2 + spread, -2 + spread)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetPoint(border2, "topleft", parent, "topleft", -2 + spread, 2 + (-spread))
PixelUtil.SetPoint(border2, "bottomleft", parent, "bottomleft", -2 + spread, -2 + spread)
border2:SetColorTexture(0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetWidth (border2, size, minPixels)
local border3 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -3 + spread, 3 + (-spread))
PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -3 + spread, -3 + spread)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetPoint(border3, "topleft", parent, "topleft", -3 + spread, 3 + (-spread))
PixelUtil.SetPoint(border3, "bottomleft", parent, "bottomleft", -3 + spread, -3 + spread)
border3:SetColorTexture(0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetWidth (border3, size, minPixels)
tinsert(parent.Borders.Layer1, border1)
@@ -3766,22 +3733,22 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread
--top
local border1 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border1, "topleft", parent, "topleft", 0 + spread, 1 + (-spread))
PixelUtil.SetPoint (border1, "topright", parent, "topright", 1 + (-spread), 1 + (-spread))
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetHeight (border1, size, minPixels)
PixelUtil.SetPoint(border1, "topleft", parent, "topleft", 0 + spread, 1 + (-spread))
PixelUtil.SetPoint(border1, "topright", parent, "topright", 1 + (-spread), 1 + (-spread))
border1:SetColorTexture(0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetHeight(border1, size, minPixels)
local border2 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border2, "topleft", parent, "topleft", -1 + spread, 2 + (-spread))
PixelUtil.SetPoint (border2, "topright", parent, "topright", 2 + (-spread), 2 + (-spread))
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetHeight (border2, size, minPixels)
PixelUtil.SetPoint(border2, "topleft", parent, "topleft", -1 + spread, 2 + (-spread))
PixelUtil.SetPoint(border2, "topright", parent, "topright", 2 + (-spread), 2 + (-spread))
border2:SetColorTexture(0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetHeight(border2, size, minPixels)
local border3 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border3, "topleft", parent, "topleft", -2 + spread, 3 + (-spread))
PixelUtil.SetPoint (border3, "topright", parent, "topright", 3 + (-spread), 3 + (-spread))
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetHeight (border3, size, minPixels)
PixelUtil.SetPoint(border3, "topleft", parent, "topleft", -2 + spread, 3 + (-spread))
PixelUtil.SetPoint(border3, "topright", parent, "topright", 3 + (-spread), 3 + (-spread))
border3:SetColorTexture(0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetHeight(border3, size, minPixels)
tinsert(parent.Borders.Layer1, border1)
tinsert(parent.Borders.Layer2, border2)
@@ -3789,21 +3756,21 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread
--right
local border1 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border1, "topright", parent, "topright", 1 + (-spread), 0 + (-spread))
PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 1 + (-spread), -1 + spread)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetPoint(border1, "topright", parent, "topright", 1 + (-spread), 0 + (-spread))
PixelUtil.SetPoint(border1, "bottomright", parent, "bottomright", 1 + (-spread), -1 + spread)
border1:SetColorTexture(0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetWidth (border1, size, minPixels)
local border2 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border2, "topright", parent, "topright", 2 + (-spread), 1 + (-spread))
PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 2 + (-spread), -2 + spread)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetPoint(border2, "topright", parent, "topright", 2 + (-spread), 1 + (-spread))
PixelUtil.SetPoint(border2, "bottomright", parent, "bottomright", 2 + (-spread), -2 + spread)
border2:SetColorTexture(0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetWidth (border2, size, minPixels)
local border3 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border3, "topright", parent, "topright", 3 + (-spread), 2 + (-spread))
PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 3 + (-spread), -3 + spread)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetPoint(border3, "topright", parent, "topright", 3 + (-spread), 2 + (-spread))
PixelUtil.SetPoint(border3, "bottomright", parent, "bottomright", 3 + (-spread), -3 + spread)
border3:SetColorTexture(0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetWidth (border3, size, minPixels)
tinsert(parent.Borders.Layer1, border1)
@@ -3811,22 +3778,22 @@ function DF:CreateBorderWithSpread (parent, alpha1, alpha2, alpha3, size, spread
tinsert(parent.Borders.Layer3, border3)
local border1 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border1, "bottomleft", parent, "bottomleft", 0 + spread, -1 + spread)
PixelUtil.SetPoint (border1, "bottomright", parent, "bottomright", 0 + (-spread), -1 + spread)
border1:SetColorTexture (0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetHeight (border1, size, minPixels)
PixelUtil.SetPoint(border1, "bottomleft", parent, "bottomleft", 0 + spread, -1 + spread)
PixelUtil.SetPoint(border1, "bottomright", parent, "bottomright", 0 + (-spread), -1 + spread)
border1:SetColorTexture(0, 0, 0, alpha1 or default_border_color1)
PixelUtil.SetHeight(border1, size, minPixels)
local border2 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border2, "bottomleft", parent, "bottomleft", -1 + spread, -2 + spread)
PixelUtil.SetPoint (border2, "bottomright", parent, "bottomright", 1 + (-spread), -2 + spread)
border2:SetColorTexture (0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetHeight (border2, size, minPixels)
PixelUtil.SetPoint(border2, "bottomleft", parent, "bottomleft", -1 + spread, -2 + spread)
PixelUtil.SetPoint(border2, "bottomright", parent, "bottomright", 1 + (-spread), -2 + spread)
border2:SetColorTexture(0, 0, 0, alpha2 or default_border_color2)
PixelUtil.SetHeight(border2, size, minPixels)
local border3 = parent:CreateTexture(nil, "background")
PixelUtil.SetPoint (border3, "bottomleft", parent, "bottomleft", -2 + spread, -3 + spread)
PixelUtil.SetPoint (border3, "bottomright", parent, "bottomright", 2 + (-spread), -3 + spread)
border3:SetColorTexture (0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetHeight (border3, size, minPixels)
PixelUtil.SetPoint(border3, "bottomleft", parent, "bottomleft", -2 + spread, -3 + spread)
PixelUtil.SetPoint(border3, "bottomright", parent, "bottomright", 2 + (-spread), -3 + spread)
border3:SetColorTexture(0, 0, 0, alpha3 or default_border_color3)
PixelUtil.SetHeight(border3, size, minPixels)
tinsert(parent.Borders.Layer1, border1)
tinsert(parent.Borders.Layer2, border2)
@@ -3940,7 +3907,7 @@ end
function DF:GetCurrentSpec()
local specIndex = DF.GetSpecialization()
if (specIndex) then
local specID = DF.GetSpecializationInfo (specIndex)
local specID = DF.GetSpecializationInfo(specIndex)
if (specID and specID ~= 0) then
return specID
end
@@ -3981,7 +3948,7 @@ function DF:QuickDispatch (func, ...)
return
end
local okay, errortext = pcall (func, ...)
local okay, errortext = pcall(func, ...)
if (not okay) then
--trigger an error msg
@@ -4021,7 +3988,7 @@ function DF:CoreDispatch (context, func, ...)
if (type(func) ~= "function") then
local stack = debugstack(2)
local errortext = "D!Framework " .. context .. " error: invalid function to call\n====================\n" .. stack .. "\n====================\n"
error (errortext)
error(errortext)
end
local okay, result1, result2, result3, result4 = xpcall(func, geterrorhandler(), ...)
@@ -4029,28 +3996,13 @@ function DF:CoreDispatch (context, func, ...)
--if (not okay) then --when using pcall
--local stack = debugstack(2)
--local errortext = "D!Framework (" .. context .. ") error: " .. result1 .. "\n====================\n" .. stack .. "\n====================\n"
--error (errortext)
--error(errortext)
--end
return result1, result2, result3, result4
end
--/run local a, b =32,3; local f=function(c,d) return c+d, 2, 3;end; print(xpcall(f,geterrorhandler(),a,b))
function DF_CALC_PERFORMANCE()
local F = CreateFrame("frame")
local T = GetTime()
local J = false
F:SetScript("OnUpdate", function(self, deltaTime)
if (not J) then
J = true
return
end
print("Elapsed Time:", deltaTime)
F:SetScript("OnUpdate", nil)
end)
end
DF.ClassIndexToFileName = {
[6] = "DEATHKNIGHT",
[1] = "WARRIOR",
@@ -4722,7 +4674,7 @@ DF.DebugMixin = {
--returns if the unit is tapped (gray health color when another player hit the unit first)
function DF:IsUnitTapDenied (unitId)
return unitId and not UnitPlayerControlled (unitId) and UnitIsTapDenied (unitId)
return unitId and not UnitPlayerControlled(unitId) and UnitIsTapDenied(unitId)
end
+1 -1
View File
@@ -80,7 +80,7 @@ function DF:NewHelp (parent, width, height, x, y, buttonWidth, buttonHeight, nam
if (not APIHelpFunctions) then
APIHelpFunctions = true
local idx = getmetatable (helpButton).__index
local idx = getmetatable(helpButton).__index
for funcName, funcAddress in pairs(idx) do
if (not HelpMetaFunctions [funcName]) then
HelpMetaFunctions [funcName] = function(object, ...)
+4 -3
View File
@@ -10,8 +10,6 @@ local loadedAPILabelFunctions = false
do
local metaPrototype = {
WidgetType = "label",
SetHook = detailsFramework.SetHook,
RunHooksForWidget = detailsFramework.RunHooksForWidget,
dversion = detailsFramework.dversion,
}
@@ -36,6 +34,7 @@ end
local LabelMetaFunctions = _G[detailsFramework.GlobalWidgetControlNames ["label"]]
detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.SetPointMixin)
detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.ScriptHookMixin)
------------------------------------------------------------------------------------------------------------
--metatables
@@ -285,7 +284,9 @@ detailsFramework:Mixin(LabelMetaFunctions, detailsFramework.SetPointMixin)
container = container.widget
end
font = font == "" and "GameFontHighlightSmall" or font or "GameFontHighlightSmall"
if (not font or font == "") then
font = "GameFontNormal"
end
labelObject.label = parent:CreateFontString(name, layer or "OVERLAY", font)
labelObject.widget = labelObject.label
+516 -79
View File
@@ -1,7 +1,10 @@
--todo: need to send a callback when setting a new language, this will be used by the volatile menu to refresh the menu
--todo: compress the language tables that aren't in use
--todo: check cooltip fonts
--[=[
namespace = DetailsFramework.Language = DetailsFramework.Language.Register()
namespace = DetailsFramework.Language
Register() = DetailsFramework.Language.Register()
Register(addonId, languageId[, gameLanguageOnly])
create a language table within an addon namespace
@@ -37,17 +40,39 @@
fontString:SetText(languageTable["STRING_MY_PHRASE"])
GetText(addonId, phraseId[, silent])
get a text from a registered addonId and phraseId
get a text from a registered addonId and phraseId, return a localized string and the languageId where the string was found, otherwise return the phraseId
@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
@phraseId: any string to identify the a translated text, example: phraseId: "OPTIONS_FRAME_WIDTH" text: "Adjust the Width of the frame."
@silent: if true won't error on invalid phrase text and instead use the phraseId as the text, it will still error on invalid addonId
ShowOptionsHelp()
print to chat the available options ids, use SetOption to set them
SetOption(addonId, optionId, value)
set an option
SetCurrentLanguage(addonId, languageId)
set the language used by default when retriving a languageTable with DF.Language.GetLanguageTable() and not passing the second argument (languageId) within the call
use this in combination with a savedVariable to use a language of the user choice
@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
@languageId: game languages: "deDE", "enUS", "esES", "esMX", "frFR", "itIT", "koKR", "ptBR", "ruRU", "zhCN", "zhTW", or any other value if 'gameLanguageOnly' is false (default)
CreateLanguageSelector(addonId, parent, callback, selectedLanguage)
create and return a dropdown (using details framework dropdown widget) to select the laguage
@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
@parent: a frame to use as parent while creating the language selector dropdown
@callback: a function which will be called when the user select a new language function(languageId) print("new language:", languageId) end
@selectedLanguage: default selected language
SetFontForLanguageId(addonId, languageId, fontPath)
SetFontByAlphabetOrRegion(addonId, latin_FontPath, cyrillic_FontPath, china_FontPath, korean_FontPath, taiwan_FontPath)
set the font to be used for different languages, if no font is registered for a language, the lib will guess if the font need to be changed and change to a compatible with the language
if a font name is passed the lib will attempt to retrive from LibSharedMedia
latin changes the font for "deDE", "enUS", "esES", "esMX", "frFR", "itIT" and "ptBR"
cyrillic for "ruRU", china for "zhCN", korean for "koKR" and taiwan for "zhTW"
@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
@languageId: game languages: "deDE", "enUS", "esES", "esMX", "frFR", "itIT", "koKR", "ptBR", "ruRU", "zhCN", "zhTW", or any other string value to represent a language already registered
RegisterObject(addonId, object, phraseId[, silent[, ...]])
to be registered, the Object need to have a SetText method
when setting a languageId with DetailsFramework.Language.SetCurrentLanguage(), automatically change the text of all registered Objects
@@ -80,14 +105,14 @@
@table: a lua table
@key: any value except nil or boolean
@vararg: arguments to pass for format(text, ...)
RegisterObjectWithDefault(addonId, object, phraseId, defaultText[, ...])
(helper function) register an object if a phraseID is valid or object:SetText(defaultText) is called
RegisterTableKeyWithDefault(addonId, table, key, phraseId, defaultText[, ...])
(helper function) register a tableKey if a phraseID is valid or table[key] = defaultText
CreateLocTable(addonId, phraseId, shouldRegister[, ...])
CreateLocTable(addonId, phraseId[, shouldRegister = true[, ...]])
make a table to pass instead of the text while using DetailsFramework widgets
this avoid to call the register object function right after creating the widget
also make easy to register the same phraseID in many different widgets
@@ -95,6 +120,18 @@
SetTextWithLocTable(object, locTable)
set the text of an object using a locTable, the object need the method SetText
SetTextWithLocTableWithDefault(object, locTable, defaultText)
set the text from the locTable if passed or use the defaultText
SetTextIfLocTableOrDefault(object, locTable)
set the text if locTable is a locTable or SetText(locTable)
RegisterTableKeyWithLocTable(table, key, locTable[, silence])
same as RegisterTableKey() but get addonId, phraseId and arguments from the locTable
RegisterObjectWithLocTable(object, locTable[, silence])
same as RegisterObject() but get addonId, phraseId and arguments from the locTable
--]=]
local DF = _G["DetailsFramework"]
@@ -106,28 +143,63 @@ local format = string.format
local unpack = table.unpack or unpack
local GetLocale = _G.GetLocale
local CONST_LANGAGEID_ENUS = "enUS"
local CONST_LANGUAGEID_ENUS = "enUS"
local gameLanguage = GetLocale()
local addonNamespaceOptions = {
ChangeOnlyRegisteredFont = false,
}
local optionsHelp = {
ChangeOnlyRegisteredFont = "when changing the language, won't change the font if the font isn't registered for the language or region",
}
local debugElabled = false
local printDebug = function(functionName, ...)
if (debugElabled) then
print("|cFFFFAA00Languages|r:", "|cFFFFFF00" .. functionName .. "|r", ...)
end
end
local supportedGameLanguages = {
["deDE"] = true,
[CONST_LANGAGEID_ENUS] = true,
[CONST_LANGUAGEID_ENUS] = true,
["esES"] = true,
["esMX"] = true,
["frFR"] = true,
["itIT"] = true,
["koKR"] = true,
["ptBR"] = true,
["koKR"] = true,
["ruRU"] = true,
["zhCN"] = true,
["zhTW"] = true,
}
--functionCallPath
local fontLanguageCompatibility = {
["deDE"] = 1,
[CONST_LANGUAGEID_ENUS] = 1,
["esES"] = 1,
["esMX"] = 1,
["frFR"] = 1,
["itIT"] = 1,
["ptBR"] = 1,
["zhCN"] = 2,
["zhTW"] = 2,
["koKR"] = 3,
["ruRU"] = 4,
}
local fontPathToLanguageId = {
["Fonts\\FRIZQT__.TTF"] = "enUS",
["Fonts\\FRIZQT___CYR.TTF"] = "ruRU",
}
local functionSignature = {
["RegisterLanguage"] = "RegisterLanguage(addonID, languageID[, gameLanguageOnly])",
["SetCurrentLanguage"] = "SetCurrentLanguage(addonID, languageID)",
["GetLanguageTable"] = "GetLanguageTable(addonID[, languageID])",
["SetFontByAlphabetOrRegion"] = "SetFontByAlphabetOrRegion(addonId, latin, cyrillic, china, korean, taiwan)",
["SetFontForLanguageId"] = "SetFontForLanguageId(addonId, languageId, fontPath)",
["GetText"] = "GetText(addonID, phraseID[, silent])",
["RegisterObject"] = "RegisterObject(addonID, object, phraseID[, silent[, ...]])",
@@ -138,18 +210,26 @@ local functionSignature = {
["RegisterObjectWithDefault"] = "RegisterObjectWithDefault(addonId, object, phraseId, defaultText[, ...])",
["RegisterTableKeyWithDefault"] = "RegisterTableKeyWithDefault(addonId, table, key, phraseId, defaultText[, ...])",
["CreateLocTable"] = "CreateLocTable(addonId, phraseId, shouldRegister[, ...])",
["SetOption"] = "SetOption(addonId, optionId, value)",
["CreateLocTable"] = "CreateLocTable(addonId, phraseId, shouldRegister[, silent[, ...]])",
["UnpackLocTable"] = "UnpackLocTable(locTable)",
["CanRegisterLocTable"] = "CanRegisterLocTable(locTable)",
["RegisterObjectWithLocTable"] = "RegisterObjectWithLocTable(object, locTable)",
["SetTextWithLocTable"] = "SetTextWithLocTable(object, locTable)",
["IsLocTable"] = "IsLocTable(locTable)",
["CanRegisterLocTable"] = "CanRegisterLocTable(locTable)",
["RegisterObjectWithLocTable"] = "RegisterObjectWithLocTable(object, locTable[, silence])",
["RegisterTableKeyWithLocTable"] = "RegisterTableKeyWithLocTable(table, key, locTable[, silence])",
["SetTextWithLocTable"] = "SetTextWithLocTable(object, locTable)",
["SetTextWithLocTableWithDefault"] = "SetTextWithLocTableWithDefault(object, locTable, defaultText)",
["SetTextIfLocTableOrDefault"] = "SetTextIfLocTableOrDefault(object, locTable or string)",
["CreateLanguageSelector"] = "DetailsFramework.Language.CreateLanguageSelector",
}
local functionCallPath = {
["RegisterLanguage"] = "DetailsFramework.Language.RegisterLanguage",
["SetCurrentLanguage"] = "DetailsFramework.Language.SetCurrentLanguage",
["GetLanguageTable"] = "DetailsFramework.Language.GetLanguageTable",
["SetFontByAlphabetOrRegion"] = "DetailsFramework.Language.SetFontByAlphabetOrRegion",
["SetFontForLanguageId"] = "DetailsFramework.Language.SetFontForLanguageId",
["GetText"] = "DetailsFramework.Language.GetText",
["RegisterObject"] = "DetailsFramework.Language.RegisterObject",
@@ -160,19 +240,27 @@ local functionCallPath = {
["RegisterObjectWithDefault"] = "DetailsFramework.Language.RegisterObjectWithDefault",
["RegisterTableKeyWithDefault"] = "DetailsFramework.Language.RegisterTableKeyWithDefault",
["SetOption"] = "DetailsFramework.Language.SetOption",
["CreateLocTable"] = "DetailsFramework.Language.CreateLocTable",
["UnpackLocTable"] = "DetailsFramework.Language.UnpackLocTable",
["CanRegisterLocTable"] = "DetailsFramework.Language.CanRegisterLocTable",
["RegisterObjectWithLocTable"] = "DetailsFramework.Language.RegisterObjectWithLocTable",
["SetTextWithLocTable"] = "DetailsFramework.Language.SetTextWithLocTable",
["IsLocTable"] = "DetailsFramework.Language.IsLocTable",
["SetTextWithLocTableWithDefault"] = "DetailsFramework.Language.SetTextWithLocTableWithDefault",
["SetTextIfLocTableOrDefault"] = "DetailsFramework.Language.SetTextIfLocTableOrDefault",
["RegisterTableKeyWithLocTable"] = "DetailsFramework.Language.RegisterTableKeyWithLocTable",
["CreateLanguageSelector"] = "CreateLanguageSelector(addonId, parent, callback, selectedLanguage)",
}
local errorText = {
["AddonID"] = "require a valid addonID (table or string) on #%d argument",
["AddonIDInvalidOrNotRegistered"] = "invalid addonID or no languages registered",
["LanguageID"] = "require a languageID supported by the game on #%d argument",
["PhraseID"] = "require a string on #%d argument",
["PhraseID"] = "require a string (phrase id) on #%d argument",
["LanguageIDInvalid"] = "require a string (language id) on #%d argument",
["FontPathInvalid"] = "require a string (font path) on #%d argument",
["NoLanguages"] = "no languages registered for addonId",
["LanguageIDNotRegistered"] = "languageID not registered",
["PhraseIDNotRegistered"] = "phraseID not registered",
@@ -184,7 +272,8 @@ local errorText = {
["InvalidTableKey"] = "require a table key on #%d argument",
["TableKeyAlreadyRegistered"] = "table already registered", --not in use
["InvalidLocTable"] = "invalid locTable on #%d argument",
["LocTableCantRegister"] = "cannot register object, locTable.register == false",
["LocTableCantRegister"] = "cannot register object or tableKey, locTable.register == false",
["InvalidOptionId"] = "invalid option on #%d argument",
}
@@ -201,6 +290,13 @@ local isValid_AddonID = function(addonId)
return true
end
local isValid_LanguageID = function(languageId)
if (type(languageId) ~= "string") then
return false
end
return true
end
local isValid_PhraseID = function(phraseId)
return type(phraseId) == "string"
end
@@ -229,11 +325,18 @@ local getOrCreateAddonNamespace = function(addonId, languageId)
languages = {},
registeredObjects = {},
tableKeys = setmetatable({}, {__mode = "k"}),
fonts = {},
--set when the first language table is registered
defaultLanguageTable = nil,
defaultLanguageTable = false,
options = {},
}
DF.table.copy(addonNamespaceTable.options, addonNamespaceOptions)
DF.Language.RegisteredNamespaces[addonId] = addonNamespaceTable
printDebug("getOrCreateAddonNamespace", "created new addon namespace for:", addonId)
end
--if the language being register is the language being in use by the client, set this language as current language
@@ -251,6 +354,15 @@ local getAddonNamespace = function(addonId)
return DF.Language.RegisteredNamespaces[addonId]
end
local setLanguageChangedCallback = function(addonNamespaceTable, callback)
printDebug("setLanguageChangedCallback", "addonId:", addonNamespaceTable.addonId, "callbackType:", type(callback))
addonNamespaceTable.onLanguageChangeCallback = callback
end
local getLanguageChangedCallback = function(addonNamespaceTable)
return addonNamespaceTable.onLanguageChangeCallback
end
local getLanguageTable = function(addonNamespaceTable, languageId)
local languageTable = addonNamespaceTable.languages[languageId]
if (not languageTable) then
@@ -259,10 +371,19 @@ local getLanguageTable = function(addonNamespaceTable, languageId)
return languageTable
end
local getRegisteredLanguages = function(addonNamespaceTable)
return addonNamespaceTable.languages
end
local getCurrentLanguageId = function(addonNamespaceTable)
return addonNamespaceTable.currentLanguageId
end
local setOption = function(addonNamespaceTable, optionId, value)
printDebug("setOption", "addonId:", addonNamespaceTable.addonId, "optionId:", optionId, "value:", value, "valueType:", type(value))
addonNamespaceTable.options[optionId] = value
end
--if invalid, the __index from the metatable get the value from the first registered table
--will return nil if the languageTable is from the first registered language
local getTextFromLangugeTable = function(languageTable, phraseId)
@@ -273,56 +394,59 @@ local getRegisteredObjects = function(addonNamespaceTable)
return addonNamespaceTable.registeredObjects
end
--return a string representing a translated text and the languageId where the string was found
--attempt to get from the current selected language, then from the game language and then from english if the other two fails
--return false if the phraseId isn't found at all
local getText = function(addonNamespaceTable, phraseId)
local currentLanguageId = getCurrentLanguageId(addonNamespaceTable)
local languageTable = getLanguageTable(addonNamespaceTable, currentLanguageId)
--if the languageTable is invalid, let the function caller handle it
--note: languageTable is always valid when the callstack started at from DF.Language.SetCurrentLanguage
if (not languageTable) then
return false
end
--by using getTextFromLangugeTable the metatable will get the default of the first registered language
--local text = getTextFromLangugeTable(languageTable, phraseId)
local text = rawget(languageTable, phraseId)
if (isValid_Text(text)) then
return text
local text = phraseId
--get the text from the current language table
if (languageTable) then
text = rawget(languageTable, phraseId)
if (isValid_Text(text)) then
return text, currentLanguageId
end
end
--the translated string wasn't found on the current language table
--attempt to get the text from the default language used in the client
local clientLanguage = GetLocale()
if (currentLanguageId ~= clientLanguage) then
languageTable = getLanguageTable(addonNamespaceTable, clientLanguage)
if (languageTable) then
--text = getTextFromLangugeTable(languageTable, phraseId)
text = rawget(languageTable, phraseId)
if (isValid_Text(text)) then
return text
return text, clientLanguage
end
end
end
--attempt to get from english
if (currentLanguageId ~= CONST_LANGAGEID_ENUS and clientLanguage ~= CONST_LANGAGEID_ENUS) then
languageTable = getLanguageTable(addonNamespaceTable, CONST_LANGAGEID_ENUS)
if (currentLanguageId ~= CONST_LANGUAGEID_ENUS and clientLanguage ~= CONST_LANGUAGEID_ENUS) then
languageTable = getLanguageTable(addonNamespaceTable, CONST_LANGUAGEID_ENUS)
if (languageTable) then
--text = getTextFromLangugeTable(languageTable, phraseId)
text = rawget(languageTable, phraseId)
if (isValid_Text(text)) then
return text
return text, CONST_LANGUAGEID_ENUS
end
end
end
return false
return false, CONST_LANGUAGEID_ENUS
end
local setLanguageTable = function(addonNamespaceTable, languageId, languageTable)
local setLanguageTableForLanguageId = function(addonNamespaceTable, languageId, languageTable)
local isFirstLanguage = not next(addonNamespaceTable.languages)
if (isFirstLanguage) then
printDebug("setLanguageTableForLanguageId", "(first to be registered) addonId:", addonNamespaceTable.addonId, "languageId:", languageId, "languageTable:", languageTable, "languageIdType:", type(languageId), "languageTableType:", type(languageTable))
--defaultLanguageTable is constant
addonNamespaceTable.defaultLanguageTable = languageTable
else
printDebug("setLanguageTableForLanguageId", "addonId:", addonNamespaceTable.addonId, "languageId:", languageId, "languageTable:", languageTable, "languageIdType:", type(languageId), "languageTableType:", type(languageTable))
local defaultLanguageMetatable = {__index = function(table, key) return addonNamespaceTable.defaultLanguageTable[key] or key end}
setmetatable(languageTable, defaultLanguageMetatable)
end
@@ -332,7 +456,15 @@ local setLanguageTable = function(addonNamespaceTable, languageId, languageTable
end
local setCurrentLanguageId = function(addonNamespaceTable, languageId)
printDebug("setCurrentLanguageId", "addonId:", addonNamespaceTable.addonId, "languageId:", languageId, "languageIdType:", type(languageId))
addonNamespaceTable.currentLanguageId = languageId
local callbackFunc = getLanguageChangedCallback(addonNamespaceTable)
if (callbackFunc) then
printDebug("setCurrentLanguageId", "addonId:", addonNamespaceTable.addonId, "calling callback", "callbackFuncType:", type(callbackFunc))
xpcall(callbackFunc, _G["geterrorhandler"](), languageId)
end
end
local parseArguments = function(...)
@@ -346,13 +478,55 @@ end
--hold information about a localization, used by registered objects and keyTables, has .phraesId, .arguments and .key (on keyTables)
local createPhraseInfoTable = function(phraseId, key, ...)
return {phraseId = phraseId, key = key, arguments = parseArguments(...)}
return {
phraseId = phraseId,
key = key,
arguments = parseArguments(...)
}
end
local updatePhraseInfoArguments = function(phraseInfoTable, ...)
local updatePhraseInfo_PhraseId = function(phraseInfoTable, phraseId)
phraseInfoTable.phraseId = phraseId
end
local updatePhraseInfo_Arguments = function(phraseInfoTable, ...)
phraseInfoTable.arguments = parseArguments(...)
end
local getFontForLanguageId = function(addonNamespaceTable, languageId)
return addonNamespaceTable.fonts[languageId]
end
local shouldChangeFontForNewLanguage = function(addonNamespaceTable, oldLanguageId, newLanguageId)
--does it need to change the font?
local oldLanguageClusterId = fontLanguageCompatibility[oldLanguageId]
local newLanguageClusterId = fontLanguageCompatibility[newLanguageId]
if (oldLanguageClusterId == newLanguageClusterId) then
--does not require to change the font
return false
else
if (addonNamespaceTable.options.ChangeOnlyRegisteredFont) then
--can change only if the font was previously registered with SetFontForLanguageId() or SetFontByAlphabetOrRegion()
local languageFontPath = getFontForLanguageId(addonNamespaceTable, newLanguageId)
if (languageFontPath) then
--the font is registered
return true, languageFontPath
end
else
local languageFontPath = getFontForLanguageId(addonNamespaceTable, newLanguageId)
if (languageFontPath) then
--the font is registered
return true, languageFontPath
else
--the font is not registered for this language, get the default font from the framework
languageFontPath = DF:GetBestFontPathForLanguage(newLanguageId)
return true, languageFontPath
end
end
end
end
--get a phraseInfo and text returning a formatted text using arguments if they exists
local getFormattedText = function(phraseInfoTable, text)
if (phraseInfoTable.arguments) then
@@ -362,21 +536,27 @@ local getFormattedText = function(phraseInfoTable, text)
end
end
local updateObjectTable_PhraseId = function(phraseInfoTable, phraseId)
phraseInfoTable.phraseId = phraseId
end
local getObjectPhraseInfoTable = function(addonNamespaceTable, object)
return addonNamespaceTable.registeredObjects[object]
end
local setObject_InternalMembers = function(object, addonId, phraseId, arguments)
local setObject_InternalMembers = function(object, addonId, phraseId, arguments, languageId)
object.__languageAddonId = addonId or object.__languageAddonId
object.__languagePhraseId = phraseId or object.__languagePhraseId
object.__languageArguments = arguments or object.__languageArguments
object.__languageId = languageId or object.__languageId
end
local setObject_Text = function(object, phraseInfoTable, text)
local setObject_Text = function(addonNamespaceTable, object, phraseInfoTable, text, textLanguageId)
if (textLanguageId ~= object.__languageId) then
local bShouldChangeFont, fontPath = shouldChangeFontForNewLanguage(addonNamespaceTable, object.__languageId, textLanguageId)
if (bShouldChangeFont) then
local font, size, flags = object:GetFont()
object:SetFont(fontPath, size, flags)
setObject_InternalMembers(object, false, false, false, textLanguageId)
end
end
local formattedText = getFormattedText(phraseInfoTable, text)
object:SetText(formattedText)
end
@@ -387,23 +567,38 @@ local objectMethod_SetTextByPhraseID = function(object, phraseId, ...)
local addonNamespaceTable = getAddonNamespace(addonId)
local phraseInfoTable = getObjectPhraseInfoTable(addonNamespaceTable, object)
updateObjectTable_PhraseId(phraseInfoTable, phraseId)
updatePhraseInfoArguments(phraseInfoTable, ...)
setObject_InternalMembers(object, addonId, phraseId, phraseInfoTable.arguments)
updatePhraseInfo_PhraseId(phraseInfoTable, phraseId)
updatePhraseInfo_Arguments(phraseInfoTable, ...)
local text = getText(addonNamespaceTable, phraseId)
setObject_Text(object, phraseInfoTable, text)
local currentLanguageId = getCurrentLanguageId(addonNamespaceTable)
--when registering a new object, consider the font already set on the obejct to be a font compatible with the client languageId
setObject_InternalMembers(object, addonId, phraseId, phraseInfoTable.arguments, currentLanguageId)
local text, textLanguageId = getText(addonNamespaceTable, phraseId)
setObject_Text(addonNamespaceTable, object, phraseInfoTable, text, textLanguageId)
return true
end
local registerObject = function(addonNamespaceTable, object, phraseId, ...)
local phraseInfoTable = createPhraseInfoTable(phraseId, nil, ...)
addonNamespaceTable.registeredObjects[object] = phraseInfoTable
local phraseInfoTable = getObjectPhraseInfoTable(addonNamespaceTable, object)
if (phraseInfoTable) then
--the object is already registered, update the phraseId and arguments
updatePhraseInfo_PhraseId(phraseInfoTable, phraseId)
updatePhraseInfo_Arguments(phraseInfoTable, ...)
else
phraseInfoTable = createPhraseInfoTable(phraseId, nil, ...)
addonNamespaceTable.registeredObjects[object] = phraseInfoTable
end
local currentLanguageId = getCurrentLanguageId(addonNamespaceTable)
--save internal information about the language directly in the object
setObject_InternalMembers(object, addonNamespaceTable.addonId, phraseId, phraseInfoTable.arguments)
setObject_InternalMembers(object, addonNamespaceTable.addonId, phraseId, phraseInfoTable.arguments, gameLanguage)
--give the object a new method
object.SetTextByPhraseID = objectMethod_SetTextByPhraseID
return phraseInfoTable
@@ -415,8 +610,8 @@ local updateAllRegisteredObjectsText = function(addonNamespaceTable)
for object, phraseInfoTable in pairs(objects) do
local phraseId = phraseInfoTable.phraseId
--note: text is always valid when the callstack started at from DF.Language.SetCurrentLanguage
local text = getText(addonNamespaceTable, phraseId)
setObject_Text(object, phraseInfoTable, text)
local text, textLanguageId = getText(addonNamespaceTable, phraseId)
setObject_Text(addonNamespaceTable, object, phraseInfoTable, text, textLanguageId)
end
end
@@ -473,9 +668,17 @@ local registerTableKey = function(addonNamespaceTable, table, key, phraseId, ...
registerTableKeyTable(addonNamespaceTable, table, tableKeyTable)
end
--create a table for this table key as a table can hold several keys with localization strings
local phraseInfoTable = createPhraseInfoTable(phraseId, key, ...)
tableKeyTable[key] = phraseInfoTable
local phraseInfoTable = getPhraseInfoFromTableKey(tableKeyTable, key)
if (phraseInfoTable) then
--the key is already registered for this table, update the phraseId and arguments
phraseInfoTable.phraseId = phraseId
phraseInfoTable.arguments = parseArguments(...)
else
phraseInfoTable = createPhraseInfoTable(phraseId, key, ...)
tableKeyTable[key] = phraseInfoTable
end
return tableKeyTable
end
@@ -486,12 +689,25 @@ local updateAllRegisteredTableKeyText = function(addonNamespaceTable)
for key, phraseInfoTable in pairs(tableKeyTable) do
local phraseId = phraseInfoTable.phraseId
--note: text is always valid when the callstack started at from DF.Language.SetCurrentLanguage
local text = getText(addonNamespaceTable, phraseId)
local text, textLanguageId = getText(addonNamespaceTable, phraseId)
setTableKey_Text(table, key, phraseInfoTable, text)
end
end
end
local updateTextOnAllObjectsAndTableKeys = function(addonNamespaceTable)
updateAllRegisteredObjectsText(addonNamespaceTable)
updateAllRegisteredTableKeyText(addonNamespaceTable)
end
local setFontForLanguageId = function(addonNamespaceTable, languageId, fontPath)
addonNamespaceTable.fonts[languageId] = fontPath
--add into the font combatibility table (which fonts can be used for a language)
if (not fontLanguageCompatibility[languageId]) then
fontLanguageCompatibility[languageId] = fontPath
end
end
--create a language table within an addon namespace
--@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
@@ -512,15 +728,123 @@ function DF.Language.RegisterLanguage(addonId, languageId, gameLanguageOnly)
--create a table to hold traslations for this languageId
local languageTable = {}
setLanguageTable(addonNamespaceTable, languageId, languageTable)
setLanguageTableForLanguageId(addonNamespaceTable, languageId, languageTable)
return languageTable
end
--@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
--@optionId: the ID of the option, check
function DF.Language.SetOption(addonId, optionId, value)
if (not isValid_AddonID(addonId)) then
error(functionCallPath["SetOption"] .. ": " .. format(errorText["AddonID"], 1) .. ", use: " .. functionSignature["SetOption"] .. ".")
end
if (not addonNamespaceOptions[optionId]) then
error(functionCallPath["SetOption"] .. ": " .. format(errorText["InvalidOptionId"], 2) .. ", use: " .. functionSignature["SetOption"] .. ".")
end
local addonNamespaceTable = getAddonNamespace(addonId)
if (not addonNamespaceTable) then
error(functionCallPath["SetOption"] .. ": " .. errorText["NoLanguages"] .. ", use: " .. functionSignature["RegisterLanguage"] .. ".")
end
setOption(addonNamespaceTable, optionId, value)
end
--print to chat the available option
function DF.Language.ShowOptionsHelp()
for optionId, descriptionString in pairs(optionsHelp) do
print(optionId .. ": " .. descriptionString)
end
end
--@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
--@languageId: game languages: "deDE", "enUS", "esES", "esMX", "frFR", "itIT", "koKR", "ptBR", "ruRU", "zhCN", "zhTW", or any other string value to represent a language
--@fontPath: a path for a font
function DF.Language.SetFontForLanguageId(addonId, languageId, fontPath)
if (not isValid_AddonID(addonId)) then
error(functionCallPath["SetFontForLanguageId"] .. ": " .. format(errorText["AddonID"], 1) .. ", use: " .. functionSignature["SetFontForLanguageId"] .. ".")
end
if (not isValid_LanguageID(languageId)) then
error(functionCallPath["SetFontForLanguageId"] .. ": " .. format(errorText["LanguageIDInvalid"], 2) .. ", use: " .. functionSignature["SetFontForLanguageId"] .. ".")
end
if (type(fontPath) ~= "string") then
error(functionCallPath["SetFontForLanguageId"] .. ": " .. format(errorText["FontPathInvalid"], 3) .. ", use: " .. functionSignature["SetFontForLanguageId"] .. ".")
end
local addonNamespaceTable = getAddonNamespace(addonId)
if (not addonNamespaceTable) then
error(functionCallPath["SetFontForLanguageId"] .. ": " .. errorText["NoLanguages"] .. ", use: " .. functionSignature["RegisterLanguage"] .. ".")
end
setFontForLanguageId(addonNamespaceTable, languageId, fontPath)
end
--@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
--@regions: accept a font name, ignored is nil is passed
function DF.Language.SetFontByAlphabetOrRegion(addonId, latin, cyrillic, china, korean, taiwan)
if (not isValid_AddonID(addonId)) then
error(functionCallPath["SetFontByAlphabetOrRegion"] .. ": " .. format(errorText["AddonID"], 1) .. ", use: " .. functionSignature["SetFontByAlphabetOrRegion"] .. ".")
end
local addonNamespaceTable = getAddonNamespace(addonId)
if (not addonNamespaceTable) then
error(functionCallPath["SetFontByAlphabetOrRegion"] .. ": " .. errorText["NoLanguages"] .. ", use: " .. functionSignature["RegisterLanguage"] .. ".")
end
if (latin) then
local fontPath = latin
if (type(fontPath) == "string") then
setFontForLanguageId(addonNamespaceTable, "deDE", fontPath)
setFontForLanguageId(addonNamespaceTable, "enUS", fontPath)
setFontForLanguageId(addonNamespaceTable, "esES", fontPath)
setFontForLanguageId(addonNamespaceTable, "esMX", fontPath)
setFontForLanguageId(addonNamespaceTable, "frFR", fontPath)
setFontForLanguageId(addonNamespaceTable, "itIT", fontPath)
setFontForLanguageId(addonNamespaceTable, "ptBR", fontPath)
end
end
if (cyrillic) then
local fontPath = cyrillic
if (type(fontPath) == "string") then
setFontForLanguageId(addonNamespaceTable, "ruRU", fontPath)
end
end
if (china) then
local fontPath = china
if (type(fontPath) == "string") then
setFontForLanguageId(addonNamespaceTable, "zhCN", fontPath)
end
end
if (korean) then
local fontPath = korean
if (type(fontPath) == "string") then
setFontForLanguageId(addonNamespaceTable, "zhTW", fontPath)
end
end
if (taiwan) then
local fontPath = taiwan
if (type(fontPath) == "string") then
local taiwanCountryLanguageId = "zhTW"
setFontForLanguageId(addonNamespaceTable, taiwanCountryLanguageId, fontPath)
end
end
end
--get the languageTable for the requested languageId within the addon namespace
--@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
--@languageId: game languages: "deDE", "enUS", "esES", "esMX", "frFR", "itIT", "koKR", "ptBR", "ruRU", "zhCN", "zhTW", or any other value if 'gameLanguageOnly' is false (default)
--@languageId: game languages: "deDE", "enUS", "esES", "esMX", "frFR", "itIT", "koKR", "ptBR", "ruRU", "zhCN", "zhTW", or any other string value to represent a language if 'gameLanguageOnly' is false (default)
--return value: languageTable
function DF.Language.GetLanguageTable(addonId, languageId)
if (not isValid_AddonID(addonId)) then
@@ -549,8 +873,8 @@ end
--set the language used when retriving a languageTable with DF.Language.GetLanguageTable() without passing the second argument (languageId)
--use this in combination with a savedVariable to use a language of the user choice
--@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
--@languageId: game languages: "deDE", "enUS", "esES", "esMX", "frFR", "itIT", "koKR", "ptBR", "ruRU", "zhCN", "zhTW", or any other value if 'gameLanguageOnly' is false (default)
function DF.Language.SetCurrentLanguage(addonId, languageId)
--@languageId: game languages: "deDE", "enUS", "esES", "esMX", "frFR", "itIT", "koKR", "ptBR", "ruRU", "zhCN", "zhTW", or any other string value to represent a language if 'gameLanguageOnly' is false (default)
function DF.Language.SetCurrentLanguage(addonId, newLanguageId)
if (not isValid_AddonID(addonId)) then
error(functionCallPath["SetCurrentLanguage"] .. ": " .. format(errorText["AddonID"], 1) .. ", use: " .. functionSignature["SetCurrentLanguage"] .. ".")
end
@@ -560,16 +884,16 @@ function DF.Language.SetCurrentLanguage(addonId, languageId)
error(functionCallPath["SetCurrentLanguage"] .. ": " .. errorText["NoLanguages"] .. ", use: " .. functionSignature["RegisterLanguage"] .. ".")
end
local languageTable = getLanguageTable(addonNamespaceTable, languageId)
local languageTable = getLanguageTable(addonNamespaceTable, newLanguageId)
if (not languageTable) then
error(functionCallPath["SetCurrentLanguage"] .. ": " .. errorText["LanguageIDNotRegistered"] .. ", use: " .. functionSignature["RegisterLanguage"] .. ".")
end
setCurrentLanguageId(languageId)
setCurrentLanguageId(addonNamespaceTable, newLanguageId)
--go into the registered objects and KeyTables and change their text
updateAllRegisteredObjectsText(addonNamespaceTable)
updateAllRegisteredTableKeyText(addonNamespaceTable)
updateTextOnAllObjectsAndTableKeys(addonNamespaceTable)
return true
end
@@ -590,9 +914,9 @@ function DF.Language.GetText(addonId, phraseId, silent)
error(functionCallPath["GetText"] .. ": " .. errorText["NoLanguages"] .. ", use: " .. functionSignature["RegisterLanguage"] .. ".")
end
local text = getText(addonNamespaceTable, phraseId)
local text, textLanguageId = getText(addonNamespaceTable, phraseId)
if (isValid_Text(text)) then
return text
return text, textLanguageId
end
if (not silent) then
@@ -628,7 +952,15 @@ function DF.Language.RegisterObject(addonId, object, phraseId, silent, ...)
local objectTable = registerObject(addonNamespaceTable, object, phraseId, ...)
local text = getText(addonNamespaceTable, phraseId)
--on being registered the FontObject is not being checked for the current font set on it
--this causes the font to have a enUS font from when it was created but wronfully signed as having ruRU font
--causing the fontstring to not change the font when settings the text
--solution: when registering a font string, get the font on it a attempt to identify the font set on it
--solution 2: will be most likely to the font to be the default from the client language, e.g. frizz_quadrata_tt if the client is running enUS
--solution 3: consider the font being used as the languageId of the client
local text, textLanguageId = getText(addonNamespaceTable, phraseId)
if (not isValid_Text(text)) then
if (not silent) then
error(functionCallPath["RegisterObject"] .. ": " .. errorText["PhraseIDNotRegistered"] .. ", use: " .. functionSignature["GetLanguageTable"] .. "['PhraseID'] = 'translated text'.")
@@ -637,7 +969,7 @@ function DF.Language.RegisterObject(addonId, object, phraseId, silent, ...)
end
end
setObject_Text(object, objectTable, text)
setObject_Text(addonNamespaceTable, object, objectTable, text, textLanguageId)
return true
end
@@ -663,10 +995,10 @@ function DF.Language.UpdateObjectArguments(addonId, object, ...)
if (not phraseInfoTable) then
error(functionCallPath["UpdateObjectArguments"] .. ": " .. errorText["ObjectNotRegistered"] .. ", use: " .. functionSignature["RegisterObject"] .. ".")
end
updatePhraseInfoArguments(phraseInfoTable, ...)
updatePhraseInfo_Arguments(phraseInfoTable, ...)
local text = getText(addonNamespaceTable, phraseInfoTable.phraseId)
setObject_Text(object, phraseInfoTable, text)
local text, textLanguageId = getText(addonNamespaceTable, phraseInfoTable.phraseId)
setObject_Text(addonNamespaceTable, object, phraseInfoTable, text, textLanguageId)
return true
end
@@ -701,7 +1033,7 @@ function DF.Language.RegisterTableKey(addonId, table, key, phraseId, silent, ...
local tableKeyTable = registerTableKey(addonNamespaceTable, table, key, phraseId, ...)
local text = getText(addonNamespaceTable, phraseId)
local text, textLanguageId = getText(addonNamespaceTable, phraseId)
if (not isValid_Text(text)) then
if (not silent) then
error(functionCallPath["RegisterTableKey"] .. ": " .. errorText["PhraseIDNotRegistered"] .. ", use: " .. functionSignature["GetLanguageTable"] .. "['PhraseID'] = 'translated text'.")
@@ -747,9 +1079,9 @@ function DF.Language.UpdateTableKeyArguments(addonId, table, key, ...)
end
local phraseInfo = getPhraseInfoFromTableKey(tableKeyTable, key) --can't nil as the line above checked if it exists
updatePhraseInfoArguments(phraseInfo, key, ...)
updatePhraseInfo_Arguments(phraseInfo, key, ...)
local text = getText(addonNamespaceTable, phraseInfo.phraseId)
local text, textLanguageId = getText(addonNamespaceTable, phraseInfo.phraseId)
setTableKey_Text(table, key, tableKeyTable, text)
return true
end
@@ -777,7 +1109,7 @@ function DF.Language.RegisterObjectWithDefault(addonId, object, phraseId, defaul
end
function DF.Language.CreateLocTable(addonId, phraseId, shouldRegister, ...)
function DF.Language.CreateLocTable(addonId, phraseId, shouldRegister, silent, ...)
if (not isValid_AddonID(addonId)) then
error(functionCallPath["CreateLocTable"] .. ": " .. format(errorText["AddonID"], 1) .. ", use: " .. functionSignature["CreateLocTable"] .. ".")
end
@@ -786,6 +1118,23 @@ function DF.Language.CreateLocTable(addonId, phraseId, shouldRegister, ...)
error(functionCallPath["CreateLocTable"] .. ": " .. format(errorText["PhraseID"], 2) .. ", use: " .. functionSignature["CreateLocTable"] .. ".")
end
local addonNamespaceTable = getAddonNamespace(addonId)
if (not addonNamespaceTable) then
error(functionCallPath["CreateLocTable"] .. ": " .. errorText["NoLanguages"] .. ", use: " .. functionSignature["CreateLocTable"] .. ".")
end
local text, textLanguageId = getText(addonNamespaceTable, phraseId)
if (not text) then
if (not silent) then
error(functionCallPath["CreateLocTable"] .. ": " .. errorText["PhraseIDNotRegistered"] .. ", use: " .. functionSignature["CreateLocTable"] .. ".")
end
return
end
if (type(shouldRegister) == "nil") then
shouldRegister = true
end
local newLocTable = {
addonId = addonId,
phraseId = phraseId,
@@ -824,7 +1173,22 @@ function DF.Language.UnpackLocTable(locTable)
end
function DF.Language.RegisterObjectWithLocTable(object, locTable)
function DF.Language.RegisterTableKeyWithLocTable(table, key, locTable, silence)
if (not DF.Language.IsLocTable(locTable)) then
error(functionCallPath["RegisterTableKeyWithLocTable"] .. ": " .. format(errorText["InvalidLocTable"], 3) .. ", use: " .. functionSignature["RegisterTableKeyWithLocTable"] .. ".")
end
local addonId, phraseId, shouldRegister, arguments = DF.Language.UnpackLocTable(locTable)
if (not shouldRegister) then
error(functionCallPath["RegisterTableKeyWithLocTable"] .. ": " .. errorText["LocTableCantRegister"] .. ", use: " .. functionSignature["RegisterTableKeyWithLocTable"] .. ".")
end
DF.Language.RegisterTableKey(addonId, table, key, phraseId, silence, arguments and unpack(arguments))
end
function DF.Language.RegisterObjectWithLocTable(object, locTable, silence)
if (not isValid_Object(object)) then
error(functionCallPath["RegisterObjectWithLocTable"] .. ": " .. format(errorText["InvalidObject"], 1) .. ", use: " .. functionSignature["RegisterObjectWithLocTable"] .. ".")
end
@@ -847,7 +1211,7 @@ function DF.Language.RegisterObjectWithLocTable(object, locTable)
error(functionCallPath["RegisterObjectWithLocTable"] .. ": " .. errorText["LocTableCantRegister"] .. ", use: " .. functionSignature["RegisterObjectWithLocTable"] .. ".")
end
DF.Language.RegisterObject(addonId, object, phraseId, true, arguments and unpack(arguments))
DF.Language.RegisterObject(addonId, object, phraseId, silence, arguments and unpack(arguments))
end
@@ -872,9 +1236,82 @@ function DF.Language.SetTextWithLocTable(object, locTable)
return true
end
local text = getText(addonNamespaceTable, phraseId)
local text, textLanguageId = getText(addonNamespaceTable, phraseId)
--can use the locTable instead of the phraseInfoTable because both has the .arguments member
setObject_Text(object, locTable, text)
setObject_Text(addonNamespaceTable, object, locTable, text, textLanguageId)
return true
end
--use the locTable is valid or set the text using 'defaultText'
--@object: any UIObject or table with SetText method
--@locTable: a locTable created from CreateLocTable()
--@defaultText: a text string
function DF.Language.SetTextWithLocTableWithDefault(object, locTable, defaultText)
if (not isValid_Object(object)) then
error(functionCallPath["SetTextWithLocTableWithDefault"] .. ": " .. format(errorText["InvalidObject"], 1) .. ", use: " .. functionSignature["SetTextWithLocTableWithDefault"] .. ".")
end
if (not DF.Language.IsLocTable(locTable)) then
object:SetText(defaultText or "")
else
DF.Language.SetTextWithLocTable(object, locTable)
end
end
--if the second parameter is a regular string, the text set is the string, otherwise it'll handle the locTable and its parameters
--@object: any UIObject or table with SetText method
--@locTable: a locTable created from CreateLocTable()
function DF.Language.SetTextIfLocTableOrDefault(object, locTable)
if (not isValid_Object(object)) then
error(functionCallPath["SetTextIfLocTableOrDefault"] .. ": " .. format(errorText["InvalidObject"], 1) .. ", use: " .. functionSignature["SetTextIfLocTableOrDefault"] .. ".")
end
if (not DF.Language.IsLocTable(locTable)) then
local textString = locTable
object:SetText(textString)
else
DF.Language.SetTextWithLocTable(object, locTable)
end
end
--@addonId: an identifier, can be any table or string, will be used when getting the table with phrase translations, example: "DetailsLocalization", "Details", "PlaterLoc", _G.Plater
--@parent: a frame to use as parent while creating the language selector dropdown
--@callback: a function which will be called when the user select a new language function(languageId) print("new language:", languageId) end
--@selectedLanguage: default selected language
function DF.Language.CreateLanguageSelector(addonId, parent, callback, selectedLanguage)
if (not isValid_AddonID(addonId)) then
error(functionCallPath["CreateLanguageSelector"] .. ": " .. format(errorText["AddonID"], 1) .. ", use: " .. functionSignature["CreateLanguageSelector"] .. ".")
end
if (type(parent) ~= "table" or not parent.GetObjectType or not parent.CreateTexture) then
error(functionCallPath["CreateLanguageSelector"] .. ": " .. format("Require a frame on #%2 argument", 2) .. ", use: " .. functionSignature["CreateLanguageSelector"] .. ".")
end
local addonNamespaceTable = getAddonNamespace(addonId)
if (not addonNamespaceTable) then
error(functionCallPath["CreateLanguageSelector"] .. ": " .. errorText["AddonIDInvalidOrNotRegistered"] .. ", use: " .. functionSignature["RegisterLanguage"] .. ".")
end
setLanguageChangedCallback(addonNamespaceTable, callback)
local allLanguagesRegistered = getRegisteredLanguages(addonNamespaceTable)
local onSelectLanguage = function(self, addonId, languageId)
DF.Language.SetCurrentLanguage(addonId, languageId)
end
local buildOptionsFunc = function()
local resultTable = {}
for languageId in pairs(allLanguagesRegistered) do
resultTable[#resultTable+1] = {value = languageId, label = languageId, onclick = onSelectLanguage} --, icon = icon, iconcolor = iconcolor, iconsize = iconsize
end
return resultTable
end
local languageSelector = DF:CreateDropDown(parent, buildOptionsFunc, selectedLanguage or getCurrentLanguageId(addonNamespaceTable), 80, 20, nil, nil, DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE"))
languageSelector:SetFixedParameter(addonId)
return languageSelector
end
+1 -1
View File
@@ -14,7 +14,7 @@ SMALL_FLOAT = 0.000001
--find distance between two players
function DF:GetDistance_Unit (unit1, unit2)
if (UnitExists (unit1) and UnitExists (unit2)) then
if (UnitExists(unit1) and UnitExists(unit2)) then
local u1X, u1Y = UnitPosition (unit1)
local u2X, u2Y = UnitPosition (unit2)
+118 -4
View File
@@ -6,6 +6,10 @@ end
local _
local getFrame = function(frame)
return rawget(frame, "widget") or frame
end
detailsFramework.WidgetFunctions = {
GetCapsule = function(self)
return self.MyObject
@@ -26,6 +30,53 @@ detailsFramework.DefaultMetaFunctionsGet = {
end,
}
detailsFramework.TooltipHandlerMixin = {
SetTooltip = function(self, tooltip)
if (tooltip) then
if (detailsFramework.Language.IsLocTable(tooltip)) then
--register the locTable as a tableKey
local locTable = tooltip
detailsFramework.Language.RegisterTableKeyWithLocTable(self, "have_tooltip", locTable)
else
self.have_tooltip = tooltip
end
else
self.have_tooltip = nil
end
end,
GetTooltip = function(self)
return self.have_tooltip
end,
ShowTooltip = function(self)
local tooltipText = self:GetTooltip()
if (type(tooltipText) == "function") then
local tooltipFunction = tooltipText
local gotTooltip, tooltipString = pcall(tooltipFunction)
if (gotTooltip) then
tooltipText = tooltipString
end
end
if (tooltipText) then
GameCooltip:Preset(2)
GameCooltip:AddLine(tooltipText)
GameCooltip:ShowCooltip(getFrame(self), "tooltip")
end
end,
HideTooltip = function(self)
local tooltipText = self:GetTooltip()
if (tooltipText) then
if (GameCooltip:IsOwner(getFrame(self))) then
GameCooltip:Hide()
end
end
end,
}
detailsFramework.DefaultMetaFunctionsSet = {
parent = function(object, value)
return object:SetParent(value)
@@ -72,10 +123,6 @@ detailsFramework.LayeredRegionMetaFunctionsGet = {
end,
}
local getFrame = function(frame)
return rawget(frame, "widget") or frame
end
detailsFramework.FrameMixin = {
SetFrameStrata = function(self, strata)
self = getFrame(self)
@@ -296,6 +343,73 @@ detailsFramework.PayloadMixin = {
end,
}
detailsFramework.ScriptHookMixin = {
RunHooksForWidget = function(self, event, ...)
local hooks = self.HookList[event]
if (not hooks) then
print(self.widget:GetName(), "no hooks for", 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,
SetHook = function(self, 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 (detailsFramework.debug) then
print(debugstack())
error("Details! Framework: invalid function for widget " .. self.WidgetType .. ".")
end
end
else
if (detailsFramework.debug) then
error("Details! Framework: unknown hook type for widget " .. self.WidgetType .. ": '" .. hookType .. "'.")
end
end
end,
HasHook = function(self, hookType, func)
if (self.HookList[hookType]) then
if (type(func) == "function") then
for i = #self.HookList[hookType], 1, -1 do
if (self.HookList[hookType][i] == func) then
return true
end
end
end
end
end,
ClearHooks = function(self)
for hookType, hookTable in pairs(self.HookList) do
table.wipe(hookTable)
end
end,
}
detailsFramework.ScrollBoxFunctions = {
Refresh = function(self)
--hide all frames and tag as not in use
+26 -28
View File
@@ -20,9 +20,6 @@ local APIBarFunctions
do
local metaPrototype = {
WidgetType = "normal_bar",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
@@ -44,7 +41,8 @@ do
end
end
local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
local BarMetaFunctions = _G[DF.GlobalWidgetControlNames["normal_bar"]]
DF:Mixin(BarMetaFunctions, DF.ScriptHookMixin)
------------------------------------------------------------------------------------------------------------
--metatables
@@ -227,7 +225,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
local smember_color = function(_object, _value)
local _value1, _value2, _value3, _value4 = DF:ParseColors(_value)
_object.statusbar:SetStatusBarColor (_value1, _value2, _value3, _value4)
_object.statusbar:SetStatusBarColor(_value1, _value2, _value3, _value4)
_object._texture.original_colors = {_value1, _value2, _value3, _value4}
_object.timer_texture:SetVertexColor(_value1, _value2, _value3, _value4)
@@ -246,7 +244,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
local _value1, _value2 = _unpack(_value)
_object._icon:SetTexture(_value1)
if (_value2) then
_object._icon:SetTexCoord (_unpack(_value2))
_object._icon:SetTexCoord(_unpack(_value2))
end
else
_object._icon:SetTexture(_value)
@@ -261,12 +259,12 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
_object.timer_texture:SetTexture(_value1)
_object.timer_textureR:SetTexture(_value1)
if (_value2) then
_object._texture:SetTexCoord (_unpack(_value2))
_object.timer_texture:SetTexCoord (_unpack(_value2))
_object.timer_textureR:SetTexCoord (_unpack(_value2))
_object._texture:SetTexCoord(_unpack(_value2))
_object.timer_texture:SetTexCoord(_unpack(_value2))
_object.timer_textureR:SetTexCoord(_unpack(_value2))
end
else
if (_value:find ("\\")) then
if (_value:find("\\")) then
_object._texture:SetTexture(_value)
else
local file = SharedMedia:Fetch ("statusbar", _value)
@@ -285,7 +283,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
end
--background texture
local smember_backgroundtexture = function(_object, _value)
if (_value:find ("\\")) then
if (_value:find("\\")) then
_object.background:SetTexture(_value)
else
local file = SharedMedia:Fetch ("statusbar", _value)
@@ -310,8 +308,8 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
--font color
local smember_textcolor = function(_object, _value)
local _value1, _value2, _value3, _value4 = DF:ParseColors(_value)
_object.textleft:SetTextColor (_value1, _value2, _value3, _value4)
return _object.textright:SetTextColor (_value1, _value2, _value3, _value4)
_object.textleft:SetTextColor(_value1, _value2, _value3, _value4)
return _object.textright:SetTextColor(_value1, _value2, _value3, _value4)
end
--outline (shadow)
local smember_outline = function(_object, _value)
@@ -421,7 +419,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
r, g, b, a = DF:ParseColors(r, g, b, a)
self._texture:SetVertexColor(r, g, b, a)
self.statusbar:SetStatusBarColor (r, g, b, a)
self.statusbar:SetStatusBarColor(r, g, b, a)
self._texture.original_colors = {r, g, b, a}
end
@@ -430,7 +428,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
self._icon:SetTexture(texture)
if (...) then
local L, R, U, D = _unpack(...)
self._icon:SetTexCoord (L, R, U, D)
self._icon:SetTexCoord(L, R, U, D)
end
end
@@ -490,7 +488,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
local OnEnter = function(frame)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnEnter", frame, capsule)
local kill = capsule:RunHooksForWidget("OnEnter", frame, capsule)
if (kill) then
return
end
@@ -507,7 +505,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
local OnLeave = function(frame)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnLeave", frame, capsule)
local kill = capsule:RunHooksForWidget("OnLeave", frame, capsule)
if (kill) then
return
end
@@ -521,7 +519,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
local OnHide = function(frame)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnHide", frame, capsule)
local kill = capsule:RunHooksForWidget("OnHide", frame, capsule)
if (kill) then
return
end
@@ -529,7 +527,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
local OnShow = function(frame)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnShow", frame, capsule)
local kill = capsule:RunHooksForWidget("OnShow", frame, capsule)
if (kill) then
return
end
@@ -537,7 +535,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
local OnMouseDown = function(frame, button)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnMouseDown", frame, button, capsule)
local kill = capsule:RunHooksForWidget("OnMouseDown", frame, button, capsule)
if (kill) then
return
end
@@ -552,7 +550,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
local OnMouseUp = function(frame, button)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnMouseUp", frame, button, capsule)
local kill = capsule:RunHooksForWidget("OnMouseUp", frame, button, capsule)
if (kill) then
return
end
@@ -568,7 +566,7 @@ local BarMetaFunctions = _G[DF.GlobalWidgetControlNames ["normal_bar"]]
function BarMetaFunctions:OnTimerEnd()
local capsule = self
local kill = capsule:RunHooksForWidget ("OnTimerEnd", self.widget, capsule)
local kill = capsule:RunHooksForWidget("OnTimerEnd", self.widget, capsule)
if (kill) then
return
end
@@ -762,14 +760,14 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name)
DF.BarNameCounter = DF.BarNameCounter + 1
elseif (not parent) then
return error ("Details! FrameWork: parent not found.", 2)
return error("Details! FrameWork: parent not found.", 2)
elseif (not container) then
container = parent
end
if (name:find ("$parent")) then
local parentName = DF.GetParentName (parent)
name = name:gsub ("$parent", parentName)
if (name:find("$parent")) then
local parentName = DF.GetParentName(parent)
name = name:gsub("$parent", parentName)
end
local BarObject = {type = "bar", dframework = true}
@@ -797,7 +795,7 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name)
--create widgets
BarObject.statusbar = CreateFrame("statusbar", name, parent)
DF:Mixin (BarObject.statusbar, DF.WidgetFunctions)
DF:Mixin(BarObject.statusbar, DF.WidgetFunctions)
build_statusbar (BarObject.statusbar)
@@ -805,7 +803,7 @@ function DF:NewBar (parent, container, name, member, w, h, value, texture_name)
if (not APIBarFunctions) then
APIBarFunctions = true
local idx = getmetatable (BarObject.statusbar).__index
local idx = getmetatable(BarObject.statusbar).__index
for funcName, funcAddress in pairs(idx) do
if (not BarMetaFunctions [funcName]) then
BarMetaFunctions [funcName] = function(object, ...)
+1720 -2124
View File
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -10,8 +10,6 @@ local APIImageFunctions = false
do
local metaPrototype = {
WidgetType = "image",
SetHook = detailsFramework.SetHook,
RunHooksForWidget = detailsFramework.RunHooksForWidget,
dversion = detailsFramework.dversion,
}
@@ -36,6 +34,7 @@ end
local ImageMetaFunctions = _G[detailsFramework.GlobalWidgetControlNames["image"]]
detailsFramework:Mixin(ImageMetaFunctions, detailsFramework.SetPointMixin)
detailsFramework:Mixin(ImageMetaFunctions, detailsFramework.ScriptHookMixin)
------------------------------------------------------------------------------------------------------------
--metatables
+16 -16
View File
@@ -26,11 +26,11 @@ local CreateImageEditorFrame = function()
editorWindow.hooks = {}
local background = DF:NewImage (editorWindow, nil, nil, nil, "background", nil, "background", "$parentBackground")
local background = DF:NewImage(editorWindow, nil, nil, nil, "background", nil, "background", "$parentBackground")
background:SetAllPoints()
background:SetTexture(0, 0, 0, .8)
local edit_texture = DF:NewImage (editorWindow, nil, 500, 500, "artwork", nil, "edit_texture", "$parentImage")
local edit_texture = DF:NewImage(editorWindow, nil, 500, 500, "artwork", nil, "edit_texture", "$parentImage")
edit_texture:SetAllPoints()
_G.DetailsFrameworkImageEdit_EditTexture = edit_texture
@@ -63,7 +63,7 @@ local CreateImageEditorFrame = function()
--Top Slider
local topCoordTexture = DF:NewImage (editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageTopCoord")
local topCoordTexture = DF:NewImage(editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageTopCoord")
topCoordTexture:SetPoint("topleft", editorWindow, "topleft")
topCoordTexture:SetPoint("topright", editorWindow, "topright")
topCoordTexture:SetColorTexture(1, 0, 0)
@@ -95,7 +95,7 @@ local CreateImageEditorFrame = function()
--Bottom Slider
local bottomCoordTexture = DF:NewImage (editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageBottomCoord")
local bottomCoordTexture = DF:NewImage(editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageBottomCoord")
bottomCoordTexture:SetPoint("bottomleft", editorWindow, "bottomleft", 0, 0)
bottomCoordTexture:SetPoint("bottomright", editorWindow, "bottomright", 0, 0)
bottomCoordTexture:SetColorTexture(1, 0, 0)
@@ -128,7 +128,7 @@ local CreateImageEditorFrame = function()
--Left Slider
local leftCoordTexture = DF:NewImage (editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageLeftCoord")
local leftCoordTexture = DF:NewImage(editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageLeftCoord")
leftCoordTexture:SetPoint("topleft", editorWindow, "topleft", 0, 0)
leftCoordTexture:SetPoint("bottomleft", editorWindow, "bottomleft", 0, 0)
leftCoordTexture:SetColorTexture(1, 0, 0)
@@ -159,7 +159,7 @@ local CreateImageEditorFrame = function()
--Right Slider
local rightCoordTexture = DF:NewImage (editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageRightCoord")
local rightCoordTexture = DF:NewImage(editorWindow, nil, nil, nil, "overlay", nil, nil, "$parentImageRightCoord")
rightCoordTexture:SetPoint("topright", editorWindow, "topright", 0, 0)
rightCoordTexture:SetPoint("bottomright", editorWindow, "bottomright", 0, 0)
rightCoordTexture:SetColorTexture(1, 0, 0)
@@ -211,7 +211,7 @@ local CreateImageEditorFrame = function()
if (alphaFrameShown) then
alphaFrame:Hide()
alphaFrameShown = false
button.text:SetTextColor (unpack(originalColor))
button.text:SetTextColor(unpack(originalColor))
end
if (ColorPickerFrame:IsShown()) then
@@ -219,7 +219,7 @@ local CreateImageEditorFrame = function()
end
if (lastButton) then
lastButton.text:SetTextColor (unpack(originalColor))
lastButton.text:SetTextColor(unpack(originalColor))
end
if (editingSide == side) then
@@ -232,7 +232,7 @@ local CreateImageEditorFrame = function()
end
editingSide = side
button.text:SetTextColor (1, 1, 1)
button.text:SetTextColor(1, 1, 1)
lastButton = button
editorWindow [side.."Slider"]:Show()
@@ -296,11 +296,11 @@ local CreateImageEditorFrame = function()
if (alphaFrameShown) then
alphaFrame:Hide()
alphaFrameShown = false
Alpha.button.text:SetTextColor (unpack(originalColor))
Alpha.button.text:SetTextColor(unpack(originalColor))
end
if (lastButton) then
lastButton.text:SetTextColor (unpack(originalColor))
lastButton.text:SetTextColor(unpack(originalColor))
if (editingSide) then
editorWindow [editingSide.."Slider"]:Hide()
end
@@ -328,7 +328,7 @@ local CreateImageEditorFrame = function()
end
if (lastButton) then
lastButton.text:SetTextColor (unpack(originalColor))
lastButton.text:SetTextColor(unpack(originalColor))
if (editingSide) then
editorWindow [editingSide.."Slider"]:Hide()
end
@@ -338,11 +338,11 @@ local CreateImageEditorFrame = function()
alphaFrame:Show()
alphaSlider:SetValue(edit_texture:GetAlpha()*100)
alphaFrameShown = true
button.text:SetTextColor (1, 1, 1)
button.text:SetTextColor(1, 1, 1)
else
alphaFrame:Hide()
alphaFrameShown = false
button.text:SetTextColor (unpack(originalColor))
button.text:SetTextColor(unpack(originalColor))
end
end
@@ -358,8 +358,8 @@ local CreateImageEditorFrame = function()
local resizer = CreateFrame("Button", nil, editorWindow.widget, "BackdropTemplate")
resizer:SetNormalTexture([[Interface\AddOns\Details\images\skins\default_skin]])
resizer:SetHighlightTexture([[Interface\AddOns\Details\images\skins\default_skin]])
resizer:GetNormalTexture():SetTexCoord (0.00146484375, 0.01513671875, 0.24560546875, 0.25927734375)
resizer:GetHighlightTexture():SetTexCoord (0.00146484375, 0.01513671875, 0.24560546875, 0.25927734375)
resizer:GetNormalTexture():SetTexCoord(0.00146484375, 0.01513671875, 0.24560546875, 0.25927734375)
resizer:GetHighlightTexture():SetTexCoord(0.00146484375, 0.01513671875, 0.24560546875, 0.25927734375)
resizer:SetWidth(16)
resizer:SetHeight(16)
resizer:SetPoint("BOTTOMRIGHT", editorWindow.widget, "BOTTOMRIGHT", 0, 0)
+278 -294
View File
File diff suppressed because it is too large Load Diff
+24 -26
View File
@@ -18,16 +18,13 @@ local APISplitBarFunctions
do
local metaPrototype = {
WidgetType = "split_bar",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["split_bar"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames["split_bar"]]
--check if is older
if ( (not oldMetaPrototype.dversion) or (oldMetaPrototype.dversion < DF.dversion) ) then
--the version is older them the currently loading one
@@ -38,11 +35,12 @@ do
end
else
--first time loading the framework
_G[DF.GlobalWidgetControlNames ["split_bar"]] = metaPrototype
_G[DF.GlobalWidgetControlNames["split_bar"]] = metaPrototype
end
end
local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames["split_bar"]]
DF:Mixin(SplitBarMetaFunctions, DF.ScriptHookMixin)
------------------------------------------------------------------------------------------------------------
--metatables
@@ -238,7 +236,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local smember_lcolor = function(_object, _value)
local _value1, _value2, _value3, _value4 = DF:ParseColors(_value)
_object.statusbar:SetStatusBarColor (_value1, _value2, _value3, _value4)
_object.statusbar:SetStatusBarColor(_value1, _value2, _value3, _value4)
_object.texture.original_colors = {_value1, _value2, _value3, _value4}
return _object.texture:SetVertexColor(_value1, _value2, _value3, _value4)
end
@@ -248,7 +246,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local _value1, _value2 = _unpack(_value)
_object.iconright:SetTexture(_value1)
if (_value2) then
_object.iconright:SetTexCoord (_unpack(_value2))
_object.iconright:SetTexCoord(_unpack(_value2))
end
else
_object.iconright:SetTexture(_value)
@@ -261,7 +259,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local _value1, _value2 = _unpack(_value)
_object.iconleft:SetTexture(_value1)
if (_value2) then
_object.iconleft:SetTexCoord (_unpack(_value2))
_object.iconleft:SetTexCoord(_unpack(_value2))
end
else
_object.iconleft:SetTexture(_value)
@@ -275,8 +273,8 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
_object.texture:SetTexture(_value1)
_object.rightTexture:SetTexture(_value1)
if (_value2) then
_object.texture:SetTexCoord (_unpack(_value2))
_object.rightTexture:SetTexCoord (_unpack(_value2))
_object.texture:SetTexCoord(_unpack(_value2))
_object.rightTexture:SetTexCoord(_unpack(_value2))
end
else
_object.texture:SetTexture(_value)
@@ -297,8 +295,8 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
--font color
local smember_textcolor = function(_object, _value)
local _value1, _value2, _value3, _value4 = DF:ParseColors(_value)
_object.textleft:SetTextColor (_value1, _value2, _value3, _value4)
return _object.textright:SetTextColor (_value1, _value2, _value3, _value4)
_object.textleft:SetTextColor(_value1, _value2, _value3, _value4)
return _object.textright:SetTextColor(_value1, _value2, _value3, _value4)
end
SplitBarMetaFunctions.SetMembers = SplitBarMetaFunctions.SetMembers or {}
@@ -421,14 +419,14 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
self.iconleft:SetTexture(texture)
if (...) then
local L, R, U, D = unpack(...)
self.iconleft:SetTexCoord (L, R, U, D)
self.iconleft:SetTexCoord(L, R, U, D)
end
end
function SplitBarMetaFunctions:SetRightIcon (texture, ...)
self.iconright:SetTexture(texture)
if (...) then
local L, R, U, D = unpack(...)
self.iconright:SetTexCoord (L, R, U, D)
self.iconright:SetTexCoord(L, R, U, D)
end
end
@@ -564,7 +562,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local OnEnter = function(frame)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnEnter", frame, capsule)
local kill = capsule:RunHooksForWidget("OnEnter", frame, capsule)
if (kill) then
return
end
@@ -578,7 +576,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local OnLeave = function(frame)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnLeave", frame, capsule)
local kill = capsule:RunHooksForWidget("OnLeave", frame, capsule)
if (kill) then
return
end
@@ -590,7 +588,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local OnHide = function(frame)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnHide", frame, capsule)
local kill = capsule:RunHooksForWidget("OnHide", frame, capsule)
if (kill) then
return
end
@@ -598,7 +596,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local OnShow = function(frame)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnShow", frame, capsule)
local kill = capsule:RunHooksForWidget("OnShow", frame, capsule)
if (kill) then
return
end
@@ -606,7 +604,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local OnMouseDown = function(frame, button)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnMouseDown", frame, button, capsule)
local kill = capsule:RunHooksForWidget("OnMouseDown", frame, button, capsule)
if (kill) then
return
end
@@ -621,7 +619,7 @@ local SplitBarMetaFunctions = _G[DF.GlobalWidgetControlNames ["split_bar"]]
local OnMouseUp = function(frame, button)
local capsule = frame.MyObject
local kill = capsule:RunHooksForWidget ("OnMouseUp", frame, button, capsule)
local kill = capsule:RunHooksForWidget("OnMouseUp", frame, button, capsule)
if (kill) then
return
end
@@ -716,15 +714,15 @@ function DF:NewSplitBar (parent, container, name, member, w, h)
DF.SplitBarCounter = DF.SplitBarCounter + 1
end
if (not parent) then
return error ("Details! FrameWork: parent not found.", 2)
return error("Details! FrameWork: parent not found.", 2)
end
if (not container) then
container = parent
end
if (name:find ("$parent")) then
local parentName = DF.GetParentName (parent)
name = name:gsub ("$parent", parentName)
if (name:find("$parent")) then
local parentName = DF.GetParentName(parent)
name = name:gsub("$parent", parentName)
end
local SplitBarObject = {type = "barsplit", dframework = true}
@@ -754,7 +752,7 @@ function DF:NewSplitBar (parent, container, name, member, w, h)
if (not APISplitBarFunctions) then
APISplitBarFunctions = true
local idx = getmetatable (SplitBarObject.statusbar).__index
local idx = getmetatable(SplitBarObject.statusbar).__index
for funcName, funcAddress in pairs(idx) do
if (not SplitBarMetaFunctions [funcName]) then
SplitBarMetaFunctions [funcName] = function(object, ...)
+217 -276
View File
@@ -1,5 +1,5 @@
local DF = _G ["DetailsFramework"]
local DF = _G["DetailsFramework"]
if (not DF or not DetailsFrameworkCanLoad) then
return
end
@@ -11,10 +11,6 @@ local APITextEntryFunctions = false
do
local metaPrototype = {
WidgetType = "textentry",
SetHook = DF.SetHook,
HasHook = DF.HasHook,
ClearHooks = DF.ClearHooks,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
@@ -40,7 +36,8 @@ local TextEntryMetaFunctions = _G[DF.GlobalWidgetControlNames["textentry"]]
DF:Mixin(TextEntryMetaFunctions, DF.SetPointMixin)
DF:Mixin(TextEntryMetaFunctions, DF.FrameMixin)
DF:Mixin(TextEntryMetaFunctions, DF.TooltipHandlerMixin)
DF:Mixin(TextEntryMetaFunctions, DF.ScriptHookMixin)
DF.TextEntryCounter = DF.TextEntryCounter or 1
@@ -227,26 +224,13 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
self.label:SetTextColor(1, .2, .2, 1)
end
--tooltip
function TextEntryMetaFunctions:SetTooltip(tooltip)
if (tooltip) then
return rawset(self, "have_tooltip", tooltip)
else
return rawset(self, "have_tooltip", nil)
end
end
function TextEntryMetaFunctions:GetTooltip()
return rawget(self, "have_tooltip")
end
--hooks
function TextEntryMetaFunctions:Enable()
if (not self.editbox:IsEnabled()) then
self.editbox:Enable()
self.editbox:SetBackdropBorderColor(unpack(self.enabled_border_color))
self.editbox:SetBackdropColor(unpack(self.enabled_backdrop_color))
self.editbox:SetTextColor (unpack(self.enabled_text_color))
self.editbox:SetTextColor(unpack(self.enabled_text_color))
if (self.editbox.borderframe) then
local r, g, b, a = DF:ParseColors(unpack(self.editbox.borderframe.onleave_backdrop))
self.editbox.borderframe:SetBackdropColor(r, g, b, a)
@@ -286,59 +270,49 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
--scripts and hooks
local OnEnter = function(textentry)
local capsule = textentry.MyObject
local kill = capsule:RunHooksForWidget ("OnEnter", textentry, capsule)
local object = textentry.MyObject
local kill = object:RunHooksForWidget("OnEnter", textentry, object)
if (kill) then
return
end
if (capsule.have_tooltip) then
GameCooltip2:Preset(2)
GameCooltip2:AddLine(capsule.have_tooltip)
GameCooltip2:ShowCooltip(textentry, "tooltip")
end
textentry.mouse_over = true
object:ShowTooltip()
if (textentry:IsEnabled()) then
textentry.mouse_over = true
if (textentry:IsEnabled()) then
textentry.current_bordercolor = textentry.current_bordercolor or {textentry:GetBackdropBorderColor()}
textentry:SetBackdropBorderColor(1, 1, 1, 1)
end
end
local OnLeave = function(textentry)
local capsule = textentry.MyObject
local kill = capsule:RunHooksForWidget ("OnLeave", textentry, capsule)
local object = textentry.MyObject
local kill = object:RunHooksForWidget("OnLeave", textentry, object)
if (kill) then
return
end
if (textentry.MyObject.have_tooltip) then
GameCooltip2:ShowMe(false)
end
textentry.mouse_over = false
if (textentry:IsEnabled()) then
object:HideTooltip()
textentry.mouse_over = false
if (textentry:IsEnabled()) then
textentry:SetBackdropBorderColor(unpack(textentry.current_bordercolor))
end
end
local OnHide = function(textentry)
local capsule = textentry.MyObject
local kill = capsule:RunHooksForWidget ("OnHide", textentry, capsule)
local object = textentry.MyObject
local kill = object:RunHooksForWidget("OnHide", textentry, object)
if (kill) then
return
end
end
local OnShow = function(textentry)
local capsule = textentry.MyObject
local kill = capsule:RunHooksForWidget ("OnShow", textentry, capsule)
local object = textentry.MyObject
local kill = object:RunHooksForWidget("OnShow", textentry, object)
if (kill) then
return
end
@@ -346,7 +320,6 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
local OnEnterPressed = function(textentry, byScript)
local object = textentry.MyObject
if (object.ignoreNextCallback) then
DF.Schedules.RunNextTick(function() object.ignoreNextCallback = nil end)
return
@@ -361,6 +334,7 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
if (string.len(text) > 0) then
textentry.text = text
if (textentry.MyObject.func) then
--need to have a dispatch here
textentry.MyObject.func(textentry.MyObject.param1, textentry.MyObject.param2, text, textentry, byScript or textentry)
end
else
@@ -376,22 +350,21 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
end
end
end
local OnEscapePressed = function(textentry)
local capsule = textentry.MyObject
local kill = capsule:RunHooksForWidget ("OnEscapePressed", textentry, capsule, capsule.text)
local object = textentry.MyObject
local kill = object:RunHooksForWidget("OnEscapePressed", textentry, object, object.text)
if (kill) then
return
end
end
textentry.focuslost = true
textentry:ClearFocus()
textentry:ClearFocus()
end
local OnSpacePressed = function(textEntry)
local object = textEntry.MyObject
local kill = object:RunHooksForWidget ("OnSpacePressed", textEntry, object)
local kill = object:RunHooksForWidget("OnSpacePressed", textEntry, object)
if (kill) then
return
end
@@ -399,7 +372,6 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
local OnEditFocusLost = function(textEntry)
local object = textEntry.MyObject
if (object.ignoreNextCallback) then
DF.Schedules.RunNextTick(function() object.ignoreNextCallback = nil end)
return
@@ -426,13 +398,13 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
textEntry.focuslost = false
end
textEntry.MyObject.label:SetTextColor (.8, .8, .8, 1)
textEntry.MyObject.label:SetTextColor(.8, .8, .8, 1)
end
end
local OnEditFocusGained = function(textentry)
local object = textentry.MyObject
local kill = object:RunHooksForWidget ("OnEditFocusGained", textentry, object)
local kill = object:RunHooksForWidget("OnEditFocusGained", textentry, object)
if (kill) then
return
end
@@ -445,40 +417,37 @@ DF.TextEntryCounter = DF.TextEntryCounter or 1
local OnChar = function(textentry, char)
local object = textentry.MyObject
local kill = object:RunHooksForWidget ("OnChar", textentry, char, object)
local kill = object:RunHooksForWidget("OnChar", textentry, char, object)
if (kill) then
return
end
end
local OnTextChanged = function(textentry, byUser)
local OnTextChanged = function(textentry, byUser)
local capsule = textentry.MyObject
local kill = capsule:RunHooksForWidget ("OnTextChanged", textentry, byUser, capsule)
local kill = capsule:RunHooksForWidget("OnTextChanged", textentry, byUser, capsule)
if (kill) then
return
end
end
local OnTabPressed = function(textentry)
local OnTabPressed = function(textentry)
local capsule = textentry.MyObject
local kill = capsule:RunHooksForWidget ("OnTabPressed", textentry, byUser, capsule)
local kill = capsule:RunHooksForWidget("OnTabPressed", textentry, byUser, capsule)
if (kill) then
return
end
if (textentry.MyObject.next) then
OnEnterPressed (textentry, false)
if (textentry.MyObject.next) then
OnEnterPressed(textentry, false)
textentry.MyObject.next:SetFocus()
end
end
function TextEntryMetaFunctions:PressEnter (byScript)
OnEnterPressed (self.editbox, byScript)
function TextEntryMetaFunctions:PressEnter(byScript)
OnEnterPressed(self.editbox, byScript)
end
------------------------------------------------------------------------------------------------------------
function TextEntryMetaFunctions:SetTemplate(template)
@@ -488,7 +457,7 @@ function TextEntryMetaFunctions:SetTemplate(template)
if (template.height) then
self.editbox:SetHeight(template.height)
end
if (template.backdrop) then
self.editbox:SetBackdrop(template.backdrop)
end
@@ -511,199 +480,171 @@ end
------------------------------------------------------------------------------------------------------------
--object constructor
function DF:CreateTextEntry (parent, func, w, h, member, name, with_label, entry_template, label_template)
function DF:CreateTextEntry(parent, func, w, h, member, name, with_label, entry_template, label_template)
return DF:NewTextEntry(parent, parent, name, member, w, h, func, nil, nil, nil, with_label, entry_template, label_template)
end
function DF:NewTextEntry(parent, container, name, member, w, h, func, param1, param2, space, with_label, entry_template, label_template)
function DF:NewTextEntry(parent, container, name, member, width, height, func, param1, param2, space, withLabel, entryTemplate, labelTemplate)
if (not name) then
name = "DetailsFrameworkTextEntryNumber" .. DF.TextEntryCounter
DF.TextEntryCounter = DF.TextEntryCounter + 1
elseif (not parent) then
return error ("Details! FrameWork: parent not found.", 2)
return error("Details! FrameWork: parent not found.", 2)
end
if (not container) then
container = parent
end
if (name:find ("$parent")) then
local parentName = DF.GetParentName (parent)
name = name:gsub ("$parent", parentName)
if (name:find("$parent")) then
local parentName = DF.GetParentName(parent)
name = name:gsub("$parent", parentName)
end
local TextEntryObject = {type = "textentry", dframework = true}
local newTextEntryObject = {type = "textentry", dframework = true}
if (member) then
parent [member] = TextEntryObject
parent[member] = newTextEntryObject
end
if (parent.dframework) then
parent = parent.widget
end
if (container.dframework) then
container = container.widget
end
--default members:
--hooks
TextEntryObject.OnEnterHook = nil
TextEntryObject.OnLeaveHook = nil
TextEntryObject.OnHideHook = nil
TextEntryObject.OnShowHook = nil
TextEntryObject.OnEnterPressedHook = nil
TextEntryObject.OnEscapePressedHook = nil
TextEntryObject.OnEditFocusGainedHook = nil
TextEntryObject.OnEditFocusLostHook = nil
TextEntryObject.OnCharHook = nil
TextEntryObject.OnTextChangedHook = nil
TextEntryObject.OnTabPressedHook = nil
--misc
TextEntryObject.container = container
TextEntryObject.have_tooltip = nil
--misc
newTextEntryObject.container = container
TextEntryObject.editbox = CreateFrame("EditBox", name, parent,"BackdropTemplate")
TextEntryObject.editbox:SetSize(232, 20)
TextEntryObject.editbox:SetBackdrop({bgFile = [["Interface\DialogFrame\UI-DialogBox-Background"]], tileSize = 64, tile = true, edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], edgeSize = 10, insets = {left = 1, right = 1, top = 0, bottom = 0}})
TextEntryObject.editbox.label = TextEntryObject.editbox:CreateFontString("$parent_Desc", "OVERLAY", "GameFontHighlightSmall")
TextEntryObject.editbox.label:SetJustifyH("left")
TextEntryObject.editbox.label:SetPoint("RIGHT", TextEntryObject.editbox, "LEFT", -2, 0)
TextEntryObject.widget = TextEntryObject.editbox
TextEntryObject.editbox:SetTextInsets (3, 0, 0, -3)
if (not width and space) then
width = space
end
--editbox
newTextEntryObject.editbox = CreateFrame("EditBox", name, parent,"BackdropTemplate")
newTextEntryObject.editbox:SetSize(232, 20)
newTextEntryObject.editbox:SetBackdrop({bgFile = [["Interface\DialogFrame\UI-DialogBox-Background"]], tileSize = 64, tile = true, edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], edgeSize = 10, insets = {left = 1, right = 1, top = 0, bottom = 0}})
newTextEntryObject.editbox:SetTextInsets(3, 0, 0, -3)
newTextEntryObject.editbox:SetWidth(width)
newTextEntryObject.editbox:SetHeight(height)
newTextEntryObject.editbox:SetJustifyH("center")
newTextEntryObject.editbox:EnableMouse(true)
newTextEntryObject.editbox:SetText("")
newTextEntryObject.editbox:SetAutoFocus(false)
newTextEntryObject.editbox:SetFontObject("GameFontHighlightSmall")
--editbox label
newTextEntryObject.editbox.label = newTextEntryObject.editbox:CreateFontString("$parent_Desc", "OVERLAY", "GameFontHighlightSmall")
newTextEntryObject.editbox.label:SetJustifyH("left")
newTextEntryObject.editbox.label:SetPoint("RIGHT", newTextEntryObject.editbox, "LEFT", -2, 0)
newTextEntryObject.label = newTextEntryObject.editbox.label
newTextEntryObject.widget = newTextEntryObject.editbox
newTextEntryObject.editbox.MyObject = newTextEntryObject
if (not APITextEntryFunctions) then
APITextEntryFunctions = true
local idx = getmetatable (TextEntryObject.editbox).__index
for funcName, funcAddress in pairs(idx) do
if (not TextEntryMetaFunctions [funcName]) then
TextEntryMetaFunctions [funcName] = function(object, ...)
local x = loadstring ( "return _G['"..object.editbox:GetName().."']:"..funcName.."(...)")
return x (...)
local idx = getmetatable(newTextEntryObject.editbox).__index
for funcName, funcAddress in pairs(idx) do
if (not TextEntryMetaFunctions[funcName]) then
TextEntryMetaFunctions[funcName] = function(object, ...)
local x = loadstring( "return _G['"..object.editbox:GetName().."']:"..funcName.."(...)")
return x(...)
end
end
end
end
TextEntryObject.editbox.MyObject = TextEntryObject
if (not w and space) then
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.")
end
end
TextEntryObject.editbox:SetWidth(w)
TextEntryObject.editbox:SetHeight(h)
TextEntryObject.editbox:SetJustifyH("center")
TextEntryObject.editbox:EnableMouse(true)
TextEntryObject.editbox:SetText("")
newTextEntryObject.editbox.current_bordercolor = {1, 1, 1, 0.7}
newTextEntryObject.enabled_border_color = {newTextEntryObject.editbox:GetBackdropBorderColor()}
newTextEntryObject.enabled_backdrop_color = {newTextEntryObject.editbox:GetBackdropColor()}
newTextEntryObject.enabled_text_color = {newTextEntryObject.editbox:GetTextColor()}
newTextEntryObject.onleave_backdrop = {newTextEntryObject.editbox:GetBackdropColor()}
newTextEntryObject.onleave_backdrop_border_color = {newTextEntryObject.editbox:GetBackdropBorderColor()}
TextEntryObject.editbox:SetAutoFocus (false)
TextEntryObject.editbox:SetFontObject ("GameFontHighlightSmall")
newTextEntryObject.func = func
newTextEntryObject.param1 = param1
newTextEntryObject.param2 = param2
newTextEntryObject.next = nil
newTextEntryObject.space = space
newTextEntryObject.tab_on_enter = false
TextEntryObject.editbox.current_bordercolor = {1, 1, 1, 0.7}
TextEntryObject.editbox:SetBackdropBorderColor(1, 1, 1, 0.7)
TextEntryObject.enabled_border_color = {TextEntryObject.editbox:GetBackdropBorderColor()}
TextEntryObject.enabled_backdrop_color = {TextEntryObject.editbox:GetBackdropColor()}
TextEntryObject.enabled_text_color = {TextEntryObject.editbox:GetTextColor()}
TextEntryObject.onleave_backdrop = {TextEntryObject.editbox:GetBackdropColor()}
TextEntryObject.onleave_backdrop_border_color = {TextEntryObject.editbox:GetBackdropBorderColor()}
TextEntryObject.func = func
TextEntryObject.param1 = param1
TextEntryObject.param2 = param2
TextEntryObject.next = nil
TextEntryObject.space = space
TextEntryObject.tab_on_enter = false
TextEntryObject.label = _G [name .. "_Desc"]
TextEntryObject.editbox:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 1, right = 1, top = 1, bottom = 1}})
TextEntryObject.editbox:SetBackdropColor(.2, .2, .2, 1)
newTextEntryObject.editbox:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, insets = {left = 1, right = 1, top = 1, bottom = 1}})
newTextEntryObject.editbox:SetBackdropColor(.2, .2, .2, 1)
newTextEntryObject.editbox:SetBackdropBorderColor(1, 1, 1, 0.7)
--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)
TextEntryObject.editbox:SetScript("OnShow", OnShow)
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)
TextEntryObject.editbox:SetScript("OnTextChanged", OnTextChanged)
TextEntryObject.editbox:SetScript("OnTabPressed", OnTabPressed)
setmetatable(TextEntryObject, TextEntryMetaFunctions)
if (with_label) then
local label = DF:CreateLabel(TextEntryObject.editbox, with_label, nil, nil, nil, "label", nil, "overlay")
label.text = with_label
TextEntryObject.editbox:SetPoint("left", label.widget, "right", 2, 0)
if (label_template) then
label:SetTemplate(label_template)
newTextEntryObject.HookList = {
OnEnter = {},
OnLeave = {},
OnHide = {},
OnShow = {},
OnEnterPressed = {},
OnEscapePressed = {},
OnSpacePressed = {},
OnEditFocusLost = {},
OnEditFocusGained = {},
OnChar = {},
OnTextChanged = {},
OnTabPressed = {},
}
newTextEntryObject.editbox:SetScript("OnEnter", OnEnter)
newTextEntryObject.editbox:SetScript("OnLeave", OnLeave)
newTextEntryObject.editbox:SetScript("OnHide", OnHide)
newTextEntryObject.editbox:SetScript("OnShow", OnShow)
newTextEntryObject.editbox:SetScript("OnEnterPressed", OnEnterPressed)
newTextEntryObject.editbox:SetScript("OnEscapePressed", OnEscapePressed)
newTextEntryObject.editbox:SetScript("OnSpacePressed", OnSpacePressed)
newTextEntryObject.editbox:SetScript("OnEditFocusLost", OnEditFocusLost)
newTextEntryObject.editbox:SetScript("OnEditFocusGained", OnEditFocusGained)
newTextEntryObject.editbox:SetScript("OnChar", OnChar)
newTextEntryObject.editbox:SetScript("OnTextChanged", OnTextChanged)
newTextEntryObject.editbox:SetScript("OnTabPressed", OnTabPressed)
setmetatable(newTextEntryObject, TextEntryMetaFunctions)
if (withLabel) then
local label = DF:CreateLabel(newTextEntryObject.editbox, withLabel, nil, nil, nil, "label", nil, "overlay")
label.text = withLabel
newTextEntryObject.editbox:SetPoint("left", label.widget, "right", 2, 0)
if (labelTemplate) then
label:SetTemplate(labelTemplate)
end
with_label = label
withLabel = label
end
if (entry_template) then
TextEntryObject:SetTemplate(entry_template)
end
return TextEntryObject, with_label
if (entryTemplate) then
newTextEntryObject:SetTemplate(entryTemplate)
end
return newTextEntryObject, withLabel
end
function DF:NewSpellEntry (parent, func, w, h, param1, param2, member, name)
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)
return editbox
return editbox
end
local function_gettext = function(self)
return self.editbox:GetText()
end
local function_settext = function(self, text)
return self.editbox:SetText(text)
end
local function_clearfocus = function(self)
return self.editbox:ClearFocus()
end
local function_setfocus = function(self)
return self.editbox:SetFocus (true)
return self.editbox:SetFocus(true)
end
------------------------------------------------------------------------------------
--auto complete
@@ -805,7 +746,7 @@ local function ColorSelection ( self, ColorCode )
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 );
@@ -830,7 +771,7 @@ end
--On Text Changed
local AutoComplete_OnTextChanged = function(editboxWidget, byUser, capsule)
capsule = capsule or editboxWidget.MyObject or editboxWidget
local chars_now = editboxWidget:GetText():len()
if (not editboxWidget.ignore_textchange) then
--backspace
@@ -892,37 +833,37 @@ local AutoComplete_OnEditFocusGained = function(editboxWidget)
--print("last word:", editboxWidget.lastword)
editboxWidget.end_selection = nil
editboxWidget.focusGained = true
capsule.characters_count = editboxWidget:GetText():len()
capsule.characters_count = editboxWidget:GetText():len()
end
local OptimizeAutoCompleteTable = function(self, wordList)
local optimizedTable = {}
local lower = string.lower
local sub = string.sub
local len = string.len
local subTables = 0
for i = 1, #wordList do
local thisWord = wordList [i]
if (len (thisWord) > 0) then
thisWord = lower (thisWord)
local firstCharacter = sub (thisWord, 1, 1)
local charTable = optimizedTable [firstCharacter]
if (not charTable) then
charTable = {}
optimizedTable [firstCharacter] = charTable
subTables = subTables + 1
end
charTable [#charTable+1] = thisWord
end
end
wordList.Optimized = optimizedTable
end
@@ -930,14 +871,14 @@ local AutoComplete_OnChar = function(editboxWidget, char, capsule)
if (char == "") then
return
end
capsule = capsule or editboxWidget.MyObject or editboxWidget
editboxWidget.end_selection = nil
if (editboxWidget.ignore_input) then
return
end
--reseta a palavra se acabou de ganhar focus e apertou espao
if (editboxWidget.focusGained and char == " ") then
capsule.lastword = ""
@@ -945,37 +886,37 @@ local AutoComplete_OnChar = function(editboxWidget, char, capsule)
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
error ("Details! Framework: TextEntry has AutoComplete but no word list table.")
error("Details! Framework: TextEntry has AutoComplete but no word list table.")
return
end
if (capsule.ShouldOptimizeAutoComplete) then
if (not wordList.Optimized) then
OptimizeAutoCompleteTable (capsule, wordList)
end
local firstCharacter = string.lower (string.sub (capsule.lastword, 1, 1))
local firstCharacter = string.lower(string.sub (capsule.lastword, 1, 1))
wordList = wordList.Optimized [firstCharacter]
if (wordList) then
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, "")
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())
@@ -986,16 +927,16 @@ local AutoComplete_OnChar = function(editboxWidget, char, capsule)
end
end
end
editboxWidget.ignore_input = false
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, "")
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())
@@ -1006,28 +947,28 @@ local AutoComplete_OnChar = function(editboxWidget, char, capsule)
end
end
end
editboxWidget.ignore_input = false
end
function TextEntryMetaFunctions:SetAsAutoComplete (poolName, poolTable, shouldOptimize)
if (not self.SetHook) then
--self is borderframe
self = self.editbox
self.editbox = self --compatible with fw functions
self.lastword = ""
self.characters_count = 0
self.poolName = poolName
self.GetLastWord = get_last_word --editbox:GetLastWord()
self.NoClearFocusOnEnterPressed = true --avoid auto clear focus
self.ShouldOptimizeAutoComplete = shouldOptimize
if (poolTable) then
self [poolName] = poolTable
end
self:HookScript ("OnEditFocusGained", AutoComplete_OnEditFocusGained)
self:HookScript ("OnEnterPressed", AutoComplete_OnEnterPressed)
self:HookScript ("OnEscapePressed", AutoComplete_OnEscapePressed)
@@ -1042,7 +983,7 @@ function TextEntryMetaFunctions:SetAsAutoComplete (poolName, poolTable, shouldOp
self.GetLastWord = get_last_word --editbox:GetLastWord()
self.NoClearFocusOnEnterPressed = true --avoid auto clear focus
self.ShouldOptimizeAutoComplete = shouldOptimize
self:SetHook("OnEditFocusGained", AutoComplete_OnEditFocusGained)
self:SetHook("OnEnterPressed", AutoComplete_OnEnterPressed)
self.editbox:HookScript ("OnEscapePressed", AutoComplete_OnEscapePressed)
@@ -1062,36 +1003,36 @@ end
function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent, showLineNumbers)
if (name:find ("$parent")) then
local parentName = DF.GetParentName (parent)
name = name:gsub ("$parent", parentName)
if (name:find("$parent")) then
local parentName = DF.GetParentName(parent)
name = name:gsub("$parent", parentName)
end
local borderframe = CreateFrame("Frame", name, parent,"BackdropTemplate")
borderframe:SetSize(w, h)
if (member) then
parent [member] = borderframe
end
local scrollframe = CreateFrame("ScrollFrame", name, borderframe, "UIPanelScrollFrameTemplate, BackdropTemplate")
local scrollframeNumberLines = CreateFrame("ScrollFrame", name .. "NumberLines", borderframe, "UIPanelScrollFrameTemplate, BackdropTemplate")
scrollframe.editbox = CreateFrame("editbox", "$parentEditBox", scrollframe,"BackdropTemplate")
scrollframe.editbox:SetMultiLine (true)
scrollframe.editbox:SetAutoFocus (false)
scrollframe.editbox:SetAutoFocus(false)
scrollframe.editbox:SetScript("OnCursorChanged", _G.ScrollingEdit_OnCursorChanged)
scrollframe.editbox:SetScript("OnEscapePressed", _G.EditBox_ClearFocus)
scrollframe.editbox:SetFontObject ("GameFontHighlightSmall")
scrollframe.editbox:SetFontObject("GameFontHighlightSmall")
scrollframe:SetScrollChild (scrollframe.editbox)
--line number
if (showLineNumbers) then
scrollframeNumberLines.editbox = CreateFrame("editbox", "$parentLineNumbers", scrollframeNumberLines, "BackdropTemplate")
scrollframeNumberLines.editbox:SetMultiLine (true)
scrollframeNumberLines.editbox:SetAutoFocus (false)
scrollframeNumberLines.editbox:SetAutoFocus(false)
scrollframeNumberLines.editbox:SetEnabled (false)
scrollframeNumberLines.editbox:SetFontObject ("GameFontHighlightSmall")
scrollframeNumberLines.editbox:SetFontObject("GameFontHighlightSmall")
scrollframeNumberLines.editbox:SetJustifyH("left")
scrollframeNumberLines.editbox:SetJustifyV ("top")
scrollframeNumberLines.editbox:SetTextColor(.3, .3, .3, .5)
@@ -1148,49 +1089,49 @@ function DF:NewSpecialLuaEditorEntry (parent, w, h, member, name, nointent, show
end
borderframe.SetAsAutoComplete = TextEntryMetaFunctions.SetAsAutoComplete
scrollframe:SetScript("OnSizeChanged", function(self)
scrollframe.editbox:SetSize(self:GetSize())
end)
scrollframe.editbox:SetJustifyH("left")
scrollframe.editbox:SetJustifyV ("top")
scrollframe.editbox:SetMaxBytes (1024000)
scrollframe.editbox:SetMaxLetters (128000)
borderframe.GetText = function_gettext
borderframe.SetText = function_settext
borderframe.ClearFocus = function_clearfocus
borderframe.SetFocus = function_setfocus
borderframe.SetTextSize = set_speciallua_editor_font_size
borderframe.Enable = TextEntryMetaFunctions.Enable
borderframe.Disable = TextEntryMetaFunctions.Disable
borderframe.SetTemplate = TextEntryMetaFunctions.SetTemplate
if (not nointent) then
IndentationLib.enable (scrollframe.editbox, nil, 4)
end
borderframe:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
borderframe:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
tile = 1, tileSize = 16, edgeSize = 16, insets = {left = 5, right = 5, top = 5, bottom = 5}})
scrollframe.editbox.current_bordercolor = {1, 1, 1, 0.7}
borderframe:SetBackdropBorderColor(1, 1, 1, 0.7)
borderframe:SetBackdropColor(0.090195, 0.090195, 0.188234, 1)
borderframe.enabled_border_color = {borderframe:GetBackdropBorderColor()}
borderframe.enabled_backdrop_color = {borderframe:GetBackdropColor()}
borderframe.enabled_text_color = {scrollframe.editbox:GetTextColor()}
borderframe.onleave_backdrop = {scrollframe.editbox:GetBackdropColor()}
borderframe.onleave_backdrop_border_color = {scrollframe.editbox:GetBackdropBorderColor()}
borderframe.scroll = scrollframe
borderframe.editbox = scrollframe.editbox
borderframe.editbox.borderframe = borderframe
return borderframe
end
+8 -18
View File
@@ -1,36 +1,26 @@
local DF = _G ["DetailsFramework"]
local DF = _G["DetailsFramework"]
if (not DF or not DetailsFrameworkCanLoad) then
return
end
local _
local rawset = rawset
local rawget = rawget
local setmetatable = setmetatable
local unpack = unpack
local type = type
local floor = math.floor
local GetTime = GetTime
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
local cleanfunction = function() end
local APITimeBarFunctions
do
local metaPrototype = {
WidgetType = "timebar",
SetHook = DF.SetHook,
RunHooksForWidget = DF.RunHooksForWidget,
dversion = DF.dversion,
}
--check if there's a metaPrototype already existing
if (_G[DF.GlobalWidgetControlNames["timebar"]]) then
--get the already existing metaPrototype
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames ["timebar"]]
local oldMetaPrototype = _G[DF.GlobalWidgetControlNames["timebar"]]
--check if is older
if ( (not oldMetaPrototype.dversion) or (oldMetaPrototype.dversion < DF.dversion) ) then
--the version is older them the currently loading one
@@ -41,12 +31,12 @@ do
end
else
--first time loading the framework
_G[DF.GlobalWidgetControlNames ["timebar"]] = metaPrototype
_G[DF.GlobalWidgetControlNames["timebar"]] = metaPrototype
end
end
local TimeBarMetaFunctions = _G[DF.GlobalWidgetControlNames["timebar"]]
DF:Mixin(TimeBarMetaFunctions, DF.ScriptHookMixin)
--methods
TimeBarMetaFunctions.SetMembers = TimeBarMetaFunctions.SetMembers or {}
@@ -62,7 +52,8 @@ TimeBarMetaFunctions.__index = function(table, key)
if (fromMe) then
return fromMe
end
return TimeBarMetaFunctions [key]
return TimeBarMetaFunctions[key]
end
TimeBarMetaFunctions.__newindex = function(table, key, value)
@@ -364,16 +355,15 @@ end
function DF:CreateTimeBar(parent, texture, width, height, value, member, name)
if (not name) then
name = "DetailsFrameworkBarNumber" .. DF.BarNameCounter
DF.BarNameCounter = DF.BarNameCounter + 1
elseif (not parent) then
return error ("Details! FrameWork: parent not found.", 2)
return error("Details! FrameWork: parent not found.", 2)
end
if (name:find ("$parent")) then
if (name:find("$parent")) then
local parentName = DF.GetParentName(parent)
name = name:gsub("$parent", parentName)
end
+6 -6
View File
@@ -685,7 +685,7 @@ function GraphFunctions:AddDataSeries(points, color, n2, linetexture)
end
if linetexture then
if not linetexture:find ("\\") and not linetexture:find ("//") then
if not linetexture:find("\\") and not linetexture:find("//") then
linetexture = TextureDirectory..linetexture
end
end
@@ -1293,11 +1293,11 @@ end
function GraphFunctions:SetLineTexture(texture)
if (type(texture) ~= "string") then
return assert (false, "Parameter 1 for SetLineTexture must be a string")
return assert(false, "Parameter 1 for SetLineTexture must be a string")
end
--full path
if (texture:find ("\\") or texture:find ("//")) then
if (texture:find("\\") or texture:find("//")) then
self.CustomLine = texture
--using an image inside lib-graph folder
else
@@ -1306,10 +1306,10 @@ function GraphFunctions:SetLineTexture(texture)
end
function GraphFunctions:SetBorderSize(border, size)
border = string.lower (border)
border = string.lower(border)
if (type(size) ~= "number") then
return assert (false, "Parameter 2 for SetBorderSize must be a number")
return assert(false, "Parameter 2 for SetBorderSize must be a number")
end
if (border == "left") then
@@ -1326,7 +1326,7 @@ function GraphFunctions:SetBorderSize(border, size)
return true
end
return assert (false, "Usage: GraphObject:SetBorderSize (LEFT RIGHT TOP BOTTOM, SIZE)")
return assert(false, "Usage: GraphObject:SetBorderSize (LEFT RIGHT TOP BOTTOM, SIZE)")
end
function GraphFunctions:CreateGridlines()
+55 -55
View File
@@ -76,9 +76,9 @@ end
return target
end
function NickTag:Msg(...)
function NickTag:Msg (...)
if (NickTag.debug) then
print("|cFFFFFF00NickTag:|r", ...)
print ("|cFFFFFF00NickTag:|r", ...)
end
end
@@ -219,15 +219,15 @@ end
return
end
local type, serial, arg3, name, realm, version = select(2, NickTag:Deserialize (data))
local _type, serial, arg3, name, realm, version = select (2, NickTag:Deserialize (data))
--0x1: received a full persona
if (type == CONST_COMM_FULLPERSONA) then
if (_type == CONST_COMM_FULLPERSONA) then
local receivedPersona = arg3
version = name
if (not receivedPersona or type(receivedPersona) ~= "table") then
NickTag:Msg("FULLPERSONA received but it's invalid ", source)
if (not receivedPersona or type (receivedPersona) ~= "table") then
NickTag:Msg ("FULLPERSONA received but it's invalid ", source)
return
end
@@ -245,14 +245,14 @@ end
if (allowNickName) then
storedPersona [CONST_INDEX_NICKNAME] = receivedPersona [CONST_INDEX_NICKNAME]
else
storedPersona [CONST_INDEX_NICKNAME] = LibStub("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_INVALID_NAME"]
storedPersona [CONST_INDEX_NICKNAME] = LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_INVALID_NAME"]
end
storedPersona [CONST_INDEX_NICKNAME] = receivedPersona [CONST_INDEX_NICKNAME]
--update the rest
--avatar path
storedPersona [CONST_INDEX_AVATAR_PATH] = type(receivedPersona [CONST_INDEX_AVATAR_PATH]) == "string" and receivedPersona [CONST_INDEX_AVATAR_PATH] or ""
storedPersona [CONST_INDEX_AVATAR_PATH] = type (receivedPersona [CONST_INDEX_AVATAR_PATH]) == "string" and receivedPersona [CONST_INDEX_AVATAR_PATH] or ""
--avatar texcoord
if (type(receivedPersona [CONST_INDEX_AVATAR_TEXCOORD]) == "boolean") then
@@ -260,10 +260,10 @@ end
elseif (type(receivedPersona [CONST_INDEX_AVATAR_TEXCOORD]) == "table") then
storedPersona [CONST_INDEX_AVATAR_TEXCOORD] = storedPersona [CONST_INDEX_AVATAR_TEXCOORD] or {}
storedPersona [CONST_INDEX_AVATAR_TEXCOORD][1] = type(receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][1]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][1] or 0
storedPersona [CONST_INDEX_AVATAR_TEXCOORD][2] = type(receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][2]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][2] or 1
storedPersona [CONST_INDEX_AVATAR_TEXCOORD][3] = type(receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][3]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][3] or 0
storedPersona [CONST_INDEX_AVATAR_TEXCOORD][4] = type(receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][4]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][4] or 1
storedPersona [CONST_INDEX_AVATAR_TEXCOORD][1] = type (receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][1]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][1] or 0
storedPersona [CONST_INDEX_AVATAR_TEXCOORD][2] = type (receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][2]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][2] or 1
storedPersona [CONST_INDEX_AVATAR_TEXCOORD][3] = type (receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][3]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][3] or 0
storedPersona [CONST_INDEX_AVATAR_TEXCOORD][4] = type (receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][4]) == "number" and receivedPersona [CONST_INDEX_AVATAR_TEXCOORD][4] or 1
else
storedPersona [CONST_INDEX_AVATAR_TEXCOORD] = {0, 1, 0, 1}
end
@@ -274,29 +274,29 @@ end
elseif (type(receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD]) == "table") then
storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD] = storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD] or {}
storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][1] = type(receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][1]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][1] or 0
storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][2] = type(receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][2]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][2] or 1
storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3] = type(receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3] or 0
storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4] = type(receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4] or 1
storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][1] = type (receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][1]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][1] or 0
storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][2] = type (receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][2]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][2] or 1
storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3] = type (receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][3] or 0
storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4] = type (receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_TEXCOORD][4] or 1
else
storedPersona [CONST_INDEX_BACKGROUND_TEXCOORD] = {0, 1, 0, 1}
end
--background path
storedPersona [CONST_INDEX_BACKGROUND_PATH] = type(receivedPersona [CONST_INDEX_BACKGROUND_PATH]) == "string" and receivedPersona [CONST_INDEX_BACKGROUND_PATH] or ""
storedPersona [CONST_INDEX_BACKGROUND_PATH] = type (receivedPersona [CONST_INDEX_BACKGROUND_PATH]) == "string" and receivedPersona [CONST_INDEX_BACKGROUND_PATH] or ""
--background color
if (type(receivedPersona [CONST_INDEX_BACKGROUND_COLOR]) == "table") then
storedPersona [CONST_INDEX_BACKGROUND_COLOR] = storedPersona [CONST_INDEX_BACKGROUND_COLOR] or {}
storedPersona [CONST_INDEX_BACKGROUND_COLOR][1] = type(receivedPersona [CONST_INDEX_BACKGROUND_COLOR][1]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_COLOR][1] or 1
storedPersona [CONST_INDEX_BACKGROUND_COLOR][2] = type(receivedPersona [CONST_INDEX_BACKGROUND_COLOR][2]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_COLOR][2] or 1
storedPersona [CONST_INDEX_BACKGROUND_COLOR][3] = type(receivedPersona [CONST_INDEX_BACKGROUND_COLOR][3]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_COLOR][3] or 1
storedPersona [CONST_INDEX_BACKGROUND_COLOR][1] = type (receivedPersona [CONST_INDEX_BACKGROUND_COLOR][1]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_COLOR][1] or 1
storedPersona [CONST_INDEX_BACKGROUND_COLOR][2] = type (receivedPersona [CONST_INDEX_BACKGROUND_COLOR][2]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_COLOR][2] or 1
storedPersona [CONST_INDEX_BACKGROUND_COLOR][3] = type (receivedPersona [CONST_INDEX_BACKGROUND_COLOR][3]) == "number" and receivedPersona [CONST_INDEX_BACKGROUND_COLOR][3] or 1
else
storedPersona [CONST_INDEX_BACKGROUND_COLOR] = {1, 1, 1}
end
NickTag:SyncSiblings()
NickTag:Msg("FULLPERSONA received and updated for character: ", source, "new nickname: ", receivedPersona [CONST_INDEX_NICKNAME])
NickTag:Msg ("FULLPERSONA received and updated for character: ", source, "new nickname: ", receivedPersona [CONST_INDEX_NICKNAME])
end
end
@@ -312,7 +312,7 @@ end
function NickTag.OnEvent (self, event, ...)
if (NickTag.EventFrame.InfoSendCooldown > time()) then
if (not NickTag.EventFrame.ScheduledSend or NickTag.EventFrame.ScheduledSend._cancelled) then
NickTag.EventFrame.ScheduledSend = C_Timer.NewTimer(30, NickTag.SendPersona)
NickTag.EventFrame.ScheduledSend = C_Timer.NewTimer (30, NickTag.SendPersona)
end
else
NickTag:SendPersona()
@@ -334,7 +334,7 @@ end
if (not nickTable) then
return
end
NickTag:Msg("SendPersona() -> broadcast")
NickTag:Msg ("SendPersona() -> broadcast")
if (NickTag.EventFrame.ScheduledSend and not NickTag.EventFrame.ScheduledSend._cancelled) then
NickTag.EventFrame.ScheduledSend:Cancel()
@@ -346,7 +346,7 @@ end
NickTag.send_scheduled = false
--auto change nickname if we have an invalid nickname
if (NickTag:GetNickname (UnitName ("player")) == LibStub("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_INVALID_NAME"]) then
if (NickTag:GetNickname (UnitName ("player")) == LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_INVALID_NAME"]) then
nickTable [CONST_INDEX_NICKNAME] = UnitName ("player")
end
@@ -378,7 +378,7 @@ end
playerPersona [CONST_INDEX_BACKGROUND_COLOR] = false
playerPersona [CONST_INDEX_REVISION] = playerPersona [CONST_INDEX_REVISION] + 1
C_Timer.After(1, NickTag.SendPersona)
C_Timer.After (1, NickTag.SendPersona)
end
end
end
@@ -405,7 +405,7 @@ end
pool.last_version = minor
else
--sometimes player guid isn't available right after logon, so, just schedule until it become available.
NickTag:ScheduleTimer("ResetCache", 0.3)
NickTag:ScheduleTimer ("ResetCache", 0.3)
end
end
@@ -489,7 +489,7 @@ end
local check_repeated = function(char)
if (char == " ") then
have_repeated = true
elseif (string.len(char) > 2) then
elseif (string.len (char) > 2) then
have_repeated = true
elseif (char == " ") then
count_spaces = count_spaces + 1
@@ -502,7 +502,7 @@ end
--as nicktag only work internally in the guild, we think that is not necessary a work filter to avoid people using bad language.
if (type(name) ~= "string") then
return false, LibStub("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_4"] --error 4 = name isn't a valid string
return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_4"] --error 4 = name isn't a valid string
end
name = trim (name)
@@ -532,9 +532,9 @@ end
--limit nickname to 12 characters, same as wow.
--cyrillic seems to double the len using 2 bytes
local len = string.len(name)
local len = string.len (name)
if (len > maxLength) then
return false, LibStub("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_1"] --error 1 = nickname is too long, max of 12 characters.
return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_1"] --error 1 = nickname is too long, max of 12 characters.
end
--check if contain any non allowed characters, by now only accpet letters, numbers and spaces.
@@ -543,13 +543,13 @@ end
-- local notallow = string.find (name, "[^a-zA-Z%s]")
-- if (notallow) then
-- return false, LibStub("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_2"] --error 2 = nickname only support letters, numbers and spaces.
-- return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_2"] --error 2 = nickname only support letters, numbers and spaces.
-- end
--[=[
for letter in name:gmatch(".") do
if (not allowedLetters[letter]) then
return false, LibStub("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_2"] --error 2 = nickname only support letters, numbers and spaces.
return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_2"] --error 2 = nickname only support letters, numbers and spaces.
end
end
--]=]
@@ -563,7 +563,7 @@ end
have_repeated = true
end
if (have_repeated) then
return false, LibStub("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_3"] --error 3 = cant use the same letter three times consecutively, 2 spaces consecutively or 3 or more spaces.
return false, LibStub ("AceLocale-3.0"):GetLocale ("NickTag-1.0")["STRING_ERROR_3"] --error 3 = cant use the same letter three times consecutively, 2 spaces consecutively or 3 or more spaces.
end
return true
@@ -578,7 +578,7 @@ end
--check if the nickname is okey to allowed to use.
local okey, errortype = NickTag:CheckName (name)
if (not okey) then
NickTag:Msg("SetNickname() invalid name ", name)
NickTag:Msg ("SetNickname() invalid name ", name)
return false, errortype
end
@@ -607,11 +607,11 @@ end
--this is a kind of protection for scripts which call SetNickname, SetColor and SetAvatar one after other, so scheduling here avoid three revisions upgrades and 3 broadcasts to the guild.
if (not NickTag.send_scheduled) then
NickTag.send_scheduled = true
NickTag:ScheduleTimer("SendPersona", 1)
NickTag:ScheduleTimer ("SendPersona", 1)
end
else
NickTag:Msg("SetNickname() name is the same on the pool ", name, nickTable [CONST_INDEX_NICKNAME])
NickTag:Msg ("SetNickname() name is the same on the pool ", name, nickTable [CONST_INDEX_NICKNAME])
end
return true
@@ -622,7 +622,7 @@ end
if (l == nil) then
l, r, t, b = 0, 1, 0, 1
elseif (type(l) == "table") then
l, r, t, b = unpack(l)
l, r, t, b = unpack (l)
end
--check data before
@@ -655,7 +655,7 @@ end
if (not NickTag.send_scheduled) then
NickTag.send_scheduled = true
NickTag:ScheduleTimer("SendPersona", 1)
NickTag:ScheduleTimer ("SendPersona", 1)
end
end
@@ -713,7 +713,7 @@ end
if (not NickTag.send_scheduled) then
NickTag.send_scheduled = true
NickTag:ScheduleTimer("SendPersona", 1)
NickTag:ScheduleTimer ("SendPersona", 1)
end
end
@@ -766,7 +766,7 @@ end
if (not silent) then
assert (type(playerName) == "string", "NickTag 'GetNicknameTable' expects a string on #1 argument.")
else
if (not playerName or type(playerName) ~= "string") then
if (not playerName or type (playerName) ~= "string") then
return
end
end
@@ -851,9 +851,9 @@ do
background_texture:SetWidth(290)
background_texture:SetHeight(75)
background_texture:SetTexture(NickTag.background_pool[1][1])
background_texture:SetTexCoord (unpack(NickTag.background_pool[1][3]))
background_texture:SetTexCoord (unpack (NickTag.background_pool[1][3]))
--
local name = avatar_pick_frame:CreateFontString("AvatarPickFrameName", "overlay", "GameFontHighlightHuge")
local name = avatar_pick_frame:CreateFontString ("AvatarPickFrameName", "overlay", "GameFontHighlightHuge")
name:SetPoint("left", avatar_texture, "right", -11, -17)
name:SetText(UnitName ("player"))
---
@@ -866,7 +866,7 @@ do
elseif (button.isBackground) then
local background = NickTag.background_pool [button.IconID]
_G.AvatarPickFrameBackgroundPreview:SetTexture( background [1] )
_G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack(background [3]))
_G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack (background [3]))
avatar_pick_frame.selected_background = background [1]
avatar_pick_frame.selected_texcoord = background [3]
end
@@ -874,7 +874,7 @@ do
local selectedColor = function()
local r, g, b = ColorPickerFrame:GetColorRGB()
background_texture:SetVertexColor(r, g, b)
background_texture:SetVertexColor (r, g, b)
avatar_pick_frame.selected_color[1] = r
avatar_pick_frame.selected_color[2] = g
avatar_pick_frame.selected_color[3] = b
@@ -883,7 +883,7 @@ do
local okey = CreateFrame("button", "AvatarPickFrameAccept", avatar_pick_frame)
okey:SetPoint("bottomright", avatar_pick_frame, "bottomright", -37, 12)
okey:SetText("Accept")
okey:SetFrameLevel(avatar_pick_frame:GetFrameLevel()+2)
okey:SetFrameLevel (avatar_pick_frame:GetFrameLevel()+2)
okey:SetScript("OnClick", function(self)
avatar_pick_frame:Hide()
if (avatar_pick_frame.callback) then
@@ -893,7 +893,7 @@ do
local change_color = CreateFrame("button", "AvatarPickFrameColor", avatar_pick_frame)
change_color:SetPoint("bottomright", avatar_pick_frame, "bottomright", -205, 12)
change_color:SetText("Color")
change_color:SetFrameLevel(avatar_pick_frame:GetFrameLevel()+2)
change_color:SetFrameLevel (avatar_pick_frame:GetFrameLevel()+2)
change_color:SetScript("OnClick", function(self)
ColorPickerFrame.func = selectedColor
@@ -1019,8 +1019,8 @@ do
end
local background = NickTag.background_pool [n]
_G.AvatarPickFrameBackgroundPreview:SetTexture( background [1] )
_G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack(background [3]))
_G.AvatarPickFrameBackgroundPreview:SetVertexColor(unpack(avatar_pick_frame.selected_color))
_G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack (background [3]))
_G.AvatarPickFrameBackgroundPreview:SetVertexColor (unpack (avatar_pick_frame.selected_color))
avatar_pick_frame.selected_background = background [1]
end
function avatar_pick_frame:SetColor (r, g, b)
@@ -1033,7 +1033,7 @@ do
if (type(b) ~= "number" or b > 1) then
b = 1
end
_G.AvatarPickFrameBackgroundPreview:SetVertexColor(r, g, b)
_G.AvatarPickFrameBackgroundPreview:SetVertexColor (r, g, b)
avatar_pick_frame.selected_color[1] = r
avatar_pick_frame.selected_color[2] = g
avatar_pick_frame.selected_color[3] = b
@@ -1048,7 +1048,7 @@ do
avatar_pick_frame:SetScript("OnShow", function()
--get player avatar
local avatar = NickTag:GetNicknameTable (UnitGUID("player"))
local avatar = NickTag:GetNicknameTable (UnitGUID ("player"))
if (avatar) then
_G.AvatarPickFrameName:SetText( avatar [1] or UnitName ("player"))
@@ -1061,7 +1061,7 @@ do
avatar_pick_frame.selected_background = avatar [CONST_INDEX_BACKGROUND_PATH] or [[Interface\PetBattles\Weather-ArcaneStorm]]
if (avatar [CONST_INDEX_BACKGROUND_TEXCOORD]) then
_G.AvatarPickFrameBackgroundPreview:SetTexCoord ( unpack(avatar [CONST_INDEX_BACKGROUND_TEXCOORD]) )
_G.AvatarPickFrameBackgroundPreview:SetTexCoord ( unpack (avatar [CONST_INDEX_BACKGROUND_TEXCOORD]) )
avatar_pick_frame.selected_texcoord = avatar [CONST_INDEX_BACKGROUND_TEXCOORD]
else
_G.AvatarPickFrameBackgroundPreview:SetTexCoord ( 0.129609375, 1, 1, 0 )
@@ -1069,10 +1069,10 @@ do
end
if (avatar [CONST_INDEX_BACKGROUND_COLOR]) then
_G.AvatarPickFrameBackgroundPreview:SetVertexColor( unpack(avatar [CONST_INDEX_BACKGROUND_COLOR]) )
_G.AvatarPickFrameBackgroundPreview:SetVertexColor ( unpack (avatar [CONST_INDEX_BACKGROUND_COLOR]) )
avatar_pick_frame.selected_color = avatar [CONST_INDEX_BACKGROUND_COLOR]
else
_G.AvatarPickFrameBackgroundPreview:SetVertexColor( 1, 1, 1 )
_G.AvatarPickFrameBackgroundPreview:SetVertexColor ( 1, 1, 1 )
avatar_pick_frame.selected_color = {1, 1, 1}
end
else
@@ -1085,9 +1085,9 @@ do
if (background) then
_G.AvatarPickFrameBackgroundPreview:SetTexture( background [1] )
avatar_pick_frame.selected_background = background [1]
_G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack(background [3]))
_G.AvatarPickFrameBackgroundPreview:SetTexCoord (unpack (background [3]))
avatar_pick_frame.selected_texcoord = background [3]
_G.AvatarPickFrameBackgroundPreview:SetVertexColor(unpack(avatar_pick_frame.selected_color))
_G.AvatarPickFrameBackgroundPreview:SetVertexColor (unpack (avatar_pick_frame.selected_color))
avatar_pick_frame.selected_color = avatar_pick_frame.selected_color
end
+108 -108
View File
@@ -230,7 +230,7 @@ do
"Arena enemy deaths now are shown in the Deaths display.",
"Guild statistics data has been wiped, this system had a major improvement overall.",
"Fixed 'Clear Overall Data' on Logout which wasn't clearing.",
{"v9.0.2.8192.144", "January 27th, 2021"},
"If you get issues with nicknames, disable any weakaura which modifies this feature.",
"Advanced Death Logs plugin got some fixes and should work properly.",
@@ -243,7 +243,7 @@ do
"Fixed 'Always Show player' on ascending sort direction.",
"Added more foods into the Ready Check plugin.",
"Fixed some issues with the coach fearure.",
{"v9.0.2.8154.144", "January 14th, 2021"},
"Added total damage bars into the player list in the Breakdown window.",
"Added 'Square' or 'Roll' mode to Details! Streamer plugin, to change the statusbar mode to Squares, visit the options panel for the plugin.",
@@ -303,7 +303,7 @@ do
"Added a new plugin: 'Cast Timeline' available at the Player Breakdown Window.",
"Added macro '/Details me' to open your Breakdown Window.",
}
local newsString = "|cFFF1F1F1"
for i = 1, #news do
@@ -334,15 +334,15 @@ do
--store functions to create options frame
Details.optionsSection = {}
--containers
--armazenas as funes do parser - All parse functions
--armazenas as funes do parser - All parse functions
_detalhes.parser = {}
_detalhes.parser_functions = {}
_detalhes.parser_frame = CreateFrame("Frame")
_detalhes.pvp_parser_frame = CreateFrame("Frame")
_detalhes.parser_frame:Hide()
_detalhes.MacroList = {
{Name = "Click on Your Own Bar", Desc = "To open the player details window on your character, like if you click on your bar in the damage window. The number '1' is the window number where it'll click.", MacroText = "/script Details:OpenPlayerDetails(1)"},
{Name = "Open Encounter Breakdown", Desc = "Open the encounter breakdown plugin. Details! Encounter Breakdown (plugin) must be enabled.", MacroText = "/script Details:OpenPlugin ('Encounter Breakdown')"},
@@ -392,7 +392,7 @@ do
--armazena os estilos salvos
_detalhes.savedStyles = {}
--armazena quais atributos possue janela de atributos - contain attributes and sub attributos wich have a detailed window (left click on a row)
_detalhes.row_singleclick_overwrite = {}
_detalhes.row_singleclick_overwrite = {}
--report
_detalhes.ReportOptions = {}
--armazena os buffs registrados - store buffs ids and functions
@@ -436,9 +436,9 @@ do
[1134] = {file = "LoadingScreen_Shadowpan_bg", coords = {0, 1, 0.29296875, 0.857421875}}, -- Tiger's Peak
--legion, thanks @pas06 on curse forge for the mapIds
[1552] = {file = "LoadingScreen_ArenaValSharah_wide", coords = {0, 1, 0.29296875, 0.857421875}}, -- Ashmane's Fall
[1504] = {file = "LoadingScreen_BlackrookHoldArena_wide", coords = {0, 1, 0.29296875, 0.857421875}}, --Black Rook Hold
--"LoadScreenOrgrimmarArena", --Ring of Valor
[1504] = {file = "LoadingScreen_BlackrookHoldArena_wide", coords = {0, 1, 0.29296875, 0.857421875}}, --Black Rook Hold
--"LoadScreenOrgrimmarArena", --Ring of Valor
}
function _detalhes:GetArenaInfo (mapid)
@@ -462,13 +462,13 @@ do
[628] = {file = "LOADSCREENISLEOFCONQUEST", coords = {0, 1, 297/1024, 878/1024}}, --isle of conquest
--[] = {file = "", coords = {0, 1, 0, 0}}, --
}
function _detalhes:GetBattlegroundInfo (mapid)
local t = _detalhes.battleground_info [mapid]
if (t) then
return t.file, t.coords
function _detalhes:GetBattlegroundInfo(mapid)
local battlegroundInfo = _detalhes.battleground_info[mapid]
if (battlegroundInfo) then
return battlegroundInfo.file, battlegroundInfo.coords
end
end
--tokenid
_detalhes.TokenID = {
["SPELL_PERIODIC_DAMAGE"] = 1,
@@ -506,7 +506,7 @@ do
["UNIT_DIED"] = 33,
["UNIT_DESTROYED"] = 34,
}
--armazena instancias inativas
_detalhes.unused_instances = {}
_detalhes.default_skin_to_use = "Minimalistic"
@@ -544,11 +544,11 @@ do
--tooltip
_detalhes.tooltip_backdrop = {
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
tile = true,
edgeSize = 16,
tileSize = 16,
edgeSize = 16,
tileSize = 16,
insets = {left = 3, right = 3, top = 4, bottom = 4}
}
_detalhes.tooltip_border_color = {1, 1, 1, 1}
@@ -560,18 +560,18 @@ do
function _detalhes:GetAttributeIcon (attribute)
return _detalhes.attribute_icons, 0.125 * (attribute - 1), 0.125 * attribute, 0, 1
end
--colors
_detalhes.default_backdropcolor = {.094117, .094117, .094117, .8}
_detalhes.default_backdropbordercolor = {0, 0, 0, 1}
--Plugins
--plugin templates
_detalhes.gump:NewColor("DETAILS_PLUGIN_BUTTONTEXT_COLOR", 0.9999, 0.8196, 0, 1)
_detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE",
_detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGINPANEL_BUTTON_TEMPLATE",
{
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {0, 0, 0, .5},
@@ -579,7 +579,7 @@ do
onentercolor = {0.3, 0.3, 0.3, .5},
}
)
_detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGINPANEL_BUTTONSELECTED_TEMPLATE",
_detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGINPANEL_BUTTONSELECTED_TEMPLATE",
{
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {0, 0, 0, .5},
@@ -587,8 +587,8 @@ do
onentercolor = {0.3, 0.3, 0.3, .5},
}
)
_detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE",
_detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGIN_BUTTON_TEMPLATE",
{
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {1, 1, 1, .5},
@@ -600,7 +600,7 @@ do
height = 20,
}
)
_detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE",
_detalhes.gump:InstallTemplate ("button", "DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE",
{
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true},
backdropcolor = {1, 1, 1, .5},
@@ -612,48 +612,48 @@ do
height = 20,
}
)
_detalhes.gump:InstallTemplate ("button", "DETAILS_TAB_BUTTON_TEMPLATE",
_detalhes.gump:InstallTemplate ("button", "DETAILS_TAB_BUTTON_TEMPLATE",
{
width = 100,
height = 20,
},
"DETAILS_PLUGIN_BUTTON_TEMPLATE"
)
_detalhes.gump:InstallTemplate ("button","DETAILS_TAB_BUTTONSELECTED_TEMPLATE",
_detalhes.gump:InstallTemplate ("button","DETAILS_TAB_BUTTONSELECTED_TEMPLATE",
{
width = 100,
height = 20,
},
"DETAILS_PLUGIN_BUTTONSELECTED_TEMPLATE"
)
_detalhes.PluginsGlobalNames = {}
_detalhes.PluginsLocalizedNames = {}
--raid -------------------------------------------------------------------
--general function for raid mode plugins
_detalhes.RaidTables = {}
_detalhes.RaidTables = {}
--menu for raid modes
_detalhes.RaidTables.Menu = {}
_detalhes.RaidTables.Menu = {}
--plugin objects for raid mode
_detalhes.RaidTables.Plugins = {}
_detalhes.RaidTables.Plugins = {}
--name to plugin object
_detalhes.RaidTables.NameTable = {}
_detalhes.RaidTables.NameTable = {}
--using by
_detalhes.RaidTables.InstancesInUse = {}
_detalhes.RaidTables.PluginsInUse = {}
_detalhes.RaidTables.InstancesInUse = {}
_detalhes.RaidTables.PluginsInUse = {}
--solo -------------------------------------------------------------------
--general functions for solo mode plugins
_detalhes.SoloTables = {}
_detalhes.SoloTables = {}
--maintain plugin menu
_detalhes.SoloTables.Menu = {}
_detalhes.SoloTables.Menu = {}
--plugins objects for solo mode
_detalhes.SoloTables.Plugins = {}
_detalhes.SoloTables.Plugins = {}
--name to plugin object
_detalhes.SoloTables.NameTable = {}
_detalhes.SoloTables.NameTable = {}
--toolbar -------------------------------------------------------------------
--plugins container
_detalhes.ToolBar = {}
@@ -688,7 +688,7 @@ do
--[[global]] DETAILS_HEALTHSTONE_ID = 47875 --Warlock's Healthstone
--[[global]] DETAILS_HEALTHSTONE2_ID = 47876 --Warlock's Healthstone (1/2 Talent)
--[[global]] DETAILS_HEALTHSTONE3_ID = 47877 --Warlock's Healthstone (2/2 Talent)
--[[global]] DETAILS_INT_POTION_ID = 40212 --Potion of Wild Magic
--[[global]] DETAILS_AGI_POTION_ID = 40211 --Potion of Speed
--[[global]] DETAILS_STR_POTION_ID = 307164
@@ -704,7 +704,7 @@ do
[DETAILS_MANA_POTION_ID] = true, -- Runic Mana Potion
[DETAILS_MANA_POTION2_ID] = true, -- Runic Mana Injector
}
else
--[[global]] DETAILS_HEALTH_POTION_ID = 307192 -- spiritual healing potion
--[[global]] DETAILS_HEALTH_POTION2_ID = 359867 --cosmic healing potion
@@ -751,21 +751,21 @@ do
fecha = ")", --close
colocacao = ". " --dot
}
_detalhes.role_texcoord = {
DAMAGER = "72:130:69:127",
HEALER = "72:130:2:60",
TANK = "5:63:69:127",
NONE = "139:196:69:127",
}
_detalhes.role_texcoord_normalized = {
DAMAGER = {72/256, 130/256, 69/256, 127/256},
HEALER = {72/256, 130/256, 2/256, 60/256},
TANK = {5/256, 63/256, 69/256, 127/256},
NONE = {139/256, 196/256, 69/256, 127/256},
}
_detalhes.player_class = {
["HUNTER"] = true,
["WARRIOR"] = true,
@@ -808,30 +808,30 @@ do
[11] = "DRUID",
[12] = "DEMONHUNTER",
}
local Loc = LibStub("AceLocale-3.0"):GetLocale ("Details")
_detalhes.segmentos = {
label = Loc ["STRING_SEGMENT"]..": ",
overall = Loc ["STRING_TOTAL"],
label = Loc ["STRING_SEGMENT"]..": ",
overall = Loc ["STRING_TOTAL"],
overall_standard = Loc ["STRING_OVERALL"],
current = Loc ["STRING_CURRENT"],
current = Loc ["STRING_CURRENT"],
current_standard = Loc ["STRING_CURRENTFIGHT"],
past = Loc ["STRING_FIGHTNUMBER"]
past = Loc ["STRING_FIGHTNUMBER"]
}
_detalhes._detalhes_props["modo_nome"] = {
[_detalhes._detalhes_props["MODO_ALONE"]] = Loc ["STRING_MODE_SELF"],
[_detalhes._detalhes_props["MODO_GROUP"]] = Loc ["STRING_MODE_GROUP"],
[_detalhes._detalhes_props["MODO_ALONE"]] = Loc ["STRING_MODE_SELF"],
[_detalhes._detalhes_props["MODO_GROUP"]] = Loc ["STRING_MODE_GROUP"],
[_detalhes._detalhes_props["MODO_ALL"]] = Loc ["STRING_MODE_ALL"],
[_detalhes._detalhes_props["MODO_RAID"]] = Loc ["STRING_MODE_RAID"]
}
--[[global]] DETAILS_MODE_SOLO = 1
--[[global]] DETAILS_MODE_RAID = 4
--[[global]] DETAILS_MODE_GROUP = 2
--[[global]] DETAILS_MODE_ALL = 3
_detalhes.icones = {
--report window
report = {
@@ -841,7 +841,7 @@ do
highlight = nil
}
}
_detalhes.missTypes = {"ABSORB", "BLOCK", "DEFLECT", "DODGE", "EVADE", "IMMUNE", "MISS", "PARRY", "REFLECT", "RESIST"} --do not localize-me
@@ -857,39 +857,39 @@ do
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--frames
local _CreateFrame = CreateFrame --api locals
local UIParent = UIParent --api locals
--Info Window
_detalhes.playerDetailWindow = _CreateFrame ("Frame", "DetailsPlayerDetailsWindow", UIParent, "BackdropTemplate")
_detalhes.PlayerDetailsWindow = _detalhes.playerDetailWindow
--Event Frame
_detalhes.listener = _CreateFrame ("Frame", nil, UIParent)
_detalhes.listener:RegisterEvent ("ADDON_LOADED")
_detalhes.listener:SetFrameStrata("LOW")
_detalhes.listener:SetFrameLevel(9)
_detalhes.listener.FrameTime = 0
_detalhes.overlay_frame = _CreateFrame ("Frame", nil, UIParent)
_detalhes.overlay_frame:SetFrameStrata("TOOLTIP")
--Pet Owner Finder
_CreateFrame ("GameTooltip", "DetailsPetOwnerFinder", nil, "GameTooltipTemplate")
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--plugin defaults
--backdrop
_detalhes.PluginDefaults = {}
_detalhes.PluginDefaults.Backdrop = {bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = true, tileSize = 16,
edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,
insets = {left = 1, right = 1, top = 1, bottom = 1}}
_detalhes.PluginDefaults.BackdropColor = {0, 0, 0, .6}
_detalhes.PluginDefaults.BackdropBorderColor = {0, 0, 0, 1}
function _detalhes.GetPluginDefaultBackdrop()
return _detalhes.PluginDefaults.Backdrop, _detalhes.PluginDefaults.BackdropColor, _detalhes.PluginDefaults.BackdropBorderColor
end
@@ -899,14 +899,14 @@ do
-- welcome panel
function _detalhes:CreateWelcomePanel (name, parent, width, height, make_movable)
local f = CreateFrame("frame", name, parent or UIParent, "BackdropTemplate")
--f:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 128, insets = {left=3, right=3, top=3, bottom=3}, edgeFile = [[Interface\AddOns\Details\images\border_welcome]], edgeSize = 16})
f:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 128, insets = {left=0, right=0, top=0, bottom=0}, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
f:SetBackdropColor(1, 1, 1, 0.75)
f:SetBackdropBorderColor(0, 0, 0, 1)
f:SetSize(width or 1, height or 1)
if (make_movable) then
f:SetScript("OnMouseDown", function(self, button)
if (self.isMoving) then
@@ -915,11 +915,11 @@ do
if (button == "RightButton") then
self:Hide()
else
self:StartMoving()
self:StartMoving()
self.isMoving = true
end
end)
f:SetScript("OnMouseUp", function(self, button)
f:SetScript("OnMouseUp", function(self, button)
if (self.isMoving and button == "LeftButton") then
self:StopMovingOrSizing()
self.isMoving = nil
@@ -928,16 +928,16 @@ do
f:SetToplevel (true)
f:SetMovable(true)
end
return f
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--functions
_detalhes.empty_function = function() end
_detalhes.empty_table = {}
--register textures and fonts for shared media
local SharedMedia = LibStub:GetLibrary ("LibSharedMedia-3.0")
--default bars
@@ -981,9 +981,9 @@ do
SharedMedia:Register("sound", "Details Threat Warning Volume 3", [[Interface\Addons\Details\sounds\threat_warning_3.ogg]])
SharedMedia:Register("sound", "Details Threat Warning Volume 4", [[Interface\Addons\Details\sounds\threat_warning_4.ogg]])
--dump table contents over chat panel
function Details.VarDump(t)
if (type(t) ~= "table") then
@@ -1013,7 +1013,7 @@ do
end
return copy
end
--delay messages
function _detalhes:DelayMsg (msg)
_detalhes.delaymsgs = _detalhes.delaymsgs or {}
@@ -1021,13 +1021,13 @@ do
end
function _detalhes:ShowDelayMsg()
if (_detalhes.delaymsgs and #_detalhes.delaymsgs > 0) then
for _, msg in ipairs(_detalhes.delaymsgs) do
for _, msg in ipairs(_detalhes.delaymsgs) do
print(msg)
end
end
_detalhes.delaymsgs = {}
end
--print messages
function _detalhes:Msg(_string, arg1, arg2, arg3, arg4)
if (self.__name) then
@@ -1037,7 +1037,7 @@ do
print(Loc ["STRING_DETAILS1"] .. (_string or ""), arg1 or "", arg2 or "", arg3 or "", arg4 or "")
end
end
--welcome
function _detalhes:WelcomeMsgLogon()
_detalhes:Msg("you can always reset the addon running the command |cFFFFFF00'/details reinstall'|r if it does fail to load after being updated.")
@@ -1070,33 +1070,33 @@ do
_G ["BINDING_HEADER_DETAILS_KEYBIND_REPORT"] = Loc ["STRING_KEYBIND_WINDOW_REPORT_HEADER"]
--keys
_G ["BINDING_NAME_DETAILS_TOGGLE_ALL"] = Loc ["STRING_KEYBIND_TOGGLE_WINDOWS"]
_G ["BINDING_NAME_DETAILS_RESET_SEGMENTS"] = Loc ["STRING_KEYBIND_RESET_SEGMENTS"]
_G ["BINDING_NAME_DETAILS_SCROLL_UP"] = Loc ["STRING_KEYBIND_SCROLL_UP"]
_G ["BINDING_NAME_DETAILS_SCROLL_DOWN"] = Loc ["STRING_KEYBIND_SCROLL_DOWN"]
_G ["BINDING_NAME_DETAILS_REPORT_WINDOW1"] = format (Loc ["STRING_KEYBIND_WINDOW_REPORT"], 1)
_G ["BINDING_NAME_DETAILS_REPORT_WINDOW2"] = format (Loc ["STRING_KEYBIND_WINDOW_REPORT"], 2)
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW1"] = format (Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 1)
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW2"] = format (Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 2)
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW3"] = format (Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 3)
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW4"] = format (Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 4)
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW5"] = format (Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 5)
_G ["BINDING_NAME_DETAILS_BOOKMARK1"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 1)
_G ["BINDING_NAME_DETAILS_BOOKMARK2"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 2)
_G ["BINDING_NAME_DETAILS_BOOKMARK3"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 3)
_G ["BINDING_NAME_DETAILS_BOOKMARK4"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 4)
_G ["BINDING_NAME_DETAILS_BOOKMARK5"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 5)
_G ["BINDING_NAME_DETAILS_BOOKMARK6"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 6)
_G ["BINDING_NAME_DETAILS_BOOKMARK7"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 7)
_G ["BINDING_NAME_DETAILS_BOOKMARK8"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 8)
_G ["BINDING_NAME_DETAILS_BOOKMARK9"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 9)
_G ["BINDING_NAME_DETAILS_BOOKMARK10"] = format (Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 10)
_G ["BINDING_NAME_DETAILS_REPORT_WINDOW1"] = format(Loc ["STRING_KEYBIND_WINDOW_REPORT"], 1)
_G ["BINDING_NAME_DETAILS_REPORT_WINDOW2"] = format(Loc ["STRING_KEYBIND_WINDOW_REPORT"], 2)
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW1"] = format(Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 1)
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW2"] = format(Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 2)
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW3"] = format(Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 3)
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW4"] = format(Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 4)
_G ["BINDING_NAME_DETAILS_TOOGGLE_WINDOW5"] = format(Loc ["STRING_KEYBIND_TOGGLE_WINDOW"], 5)
_G ["BINDING_NAME_DETAILS_BOOKMARK1"] = format(Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 1)
_G ["BINDING_NAME_DETAILS_BOOKMARK2"] = format(Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 2)
_G ["BINDING_NAME_DETAILS_BOOKMARK3"] = format(Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 3)
_G ["BINDING_NAME_DETAILS_BOOKMARK4"] = format(Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 4)
_G ["BINDING_NAME_DETAILS_BOOKMARK5"] = format(Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 5)
_G ["BINDING_NAME_DETAILS_BOOKMARK6"] = format(Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 6)
_G ["BINDING_NAME_DETAILS_BOOKMARK7"] = format(Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 7)
_G ["BINDING_NAME_DETAILS_BOOKMARK8"] = format(Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 8)
_G ["BINDING_NAME_DETAILS_BOOKMARK9"] = format(Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 9)
_G ["BINDING_NAME_DETAILS_BOOKMARK10"] = format(Loc ["STRING_KEYBIND_BOOKMARK_NUMBER"], 10)
end
if (select(4, GetBuildInfo()) >= 100000) then
+3 -3
View File
@@ -74,11 +74,11 @@
end
function combate:InstanceType()
return rawget (self, "instance_type")
return rawget(self, "instance_type")
end
function combate:IsTrash()
return rawget (self, "is_trash")
return rawget(self, "is_trash")
end
function combate:GetDifficulty()
@@ -161,7 +161,7 @@
elseif (self.is_mythic_dungeon_trash) then
return self.is_mythic_dungeon_trash.ZoneName .. " (" .. Loc ["STRING_SEGMENTS_LIST_TRASH"] .. ")"
elseif (rawget (self, "is_trash")) then
elseif (rawget(self, "is_trash")) then
return Loc ["STRING_SEGMENT_TRASH"]
else
+461 -488
View File
File diff suppressed because it is too large Load Diff
+172 -169
View File
@@ -454,7 +454,7 @@ end
local total = 0
if (Details.time_type == 2 or not Details:CaptureGet ("damage")) then
if (Details.time_type == 2 or not Details:CaptureGet("damage")) then
for _, actor in ipairs(container) do
if (actor.grupo) then
actor.last_dps = actor.total / combat_time
@@ -661,8 +661,8 @@ end
local lineHeight = Details.tooltip.line_height
for index, t in ipairs(Targets) do
GameCooltip:AddLine(Details:GetOnlyName(t[1]), Details:ToK(t[2]) .. " (" .. format ("%.1f", t[2]/total*100) .. "%)")
local class, _, _, _, _, r, g, b = Details:GetClass (t[1])
GameCooltip:AddLine(Details:GetOnlyName(t[1]), Details:ToK(t[2]) .. " (" .. format("%.1f", t[2]/total*100) .. "%)")
local class, _, _, _, _, r, g, b = Details:GetClass(t[1])
GameCooltip:AddStatusBar (t[2]/top*100, 1, r, g, b, 0.8, false, byspell_tooltip_background)
@@ -903,7 +903,7 @@ end
}
local new_code = DTBS_search_code
new_code = new_code:gsub ("@SPELLID@", spell [1])
new_code = new_code:gsub("@SPELLID@", spell [1])
new_custom_object.script = new_code
tinsert(Details.custom, new_custom_object)
@@ -914,7 +914,7 @@ end
end
local DTBS_format_name = function(player_name) return Details:GetOnlyName(player_name) end
local DTBS_format_amount = function(amount) return Details:ToK(amount) .. " (" .. format ("%.1f", amount / bs_tooltip_table.damage_total * 100) .. "%)" end
local DTBS_format_amount = function(amount) return Details:ToK(amount) .. " (" .. format("%.1f", amount / bs_tooltip_table.damage_total * 100) .. "%)" end
function atributo_damage:ReportSingleDTBSLine (spell, instance, ShiftKeyDown, ControlKeyDown)
if (ControlKeyDown) then
@@ -927,12 +927,12 @@ end
local spelllink = Details:GetSpellLink(spell [1])
local report_table = {"Details!: " .. Loc ["STRING_CUSTOM_DTBS"] .. " " .. spelllink}
Details:FormatReportLines (report_table, bs_tooltip_table, DTBS_format_name, DTBS_format_amount)
Details:FormatReportLines(report_table, bs_tooltip_table, DTBS_format_name, DTBS_format_amount)
return Details:Reportar (report_table, {_no_current = true, _no_inverse = true, _custom = true})
return Details:Reportar(report_table, {_no_current = true, _no_inverse = true, _custom = true})
end
function atributo_damage:AtualizarBySpell (tabela, whichRowLine, colocacao, instance)
function atributo_damage:AtualizarBySpell(tabela, whichRowLine, colocacao, instance)
tabela ["byspell"] = true --marca que esta tabela uma tabela de frags, usado no controla na hora de montar o tooltip
local thisLine = instance.barras [whichRowLine] --pega a referncia da barra na janela
@@ -943,9 +943,9 @@ end
thisLine.minha_tabela = tabela
local spellname, _, spellicon = _GetSpellInfo(tabela [1])
local spellName, _, spellIcon = _GetSpellInfo(tabela[1])
tabela.nome = spellname --evita dar erro ao redimencionar a janela
tabela.nome = spellName --evita dar erro ao redimencionar a janela
tabela.minha_barra = whichRowLine
thisLine.colocacao = colocacao
@@ -958,27 +958,29 @@ end
local porcentagem
if (instance.row_info.percent_type == 1) then
porcentagem = format ("%.1f", tabela [2] / total * 100)
porcentagem = format("%.1f", tabela [2] / total * 100)
elseif (instance.row_info.percent_type == 2) then
porcentagem = format ("%.1f", tabela [2] / instance.top * 100)
porcentagem = format("%.1f", tabela [2] / instance.top * 100)
end
thisLine.lineText1:SetText(colocacao .. ". " .. spellname)
thisLine.lineText1:SetText(colocacao .. ". " .. spellName)
local bars_show_data = instance.row_info.textR_show_data
local spell_damage = tabela [2] -- spell_damage passar por uma ToK function, precisa ser number
local spell_damage = tabela[2] -- spell_damage passar por uma ToK function, precisa ser number
if (not bars_show_data [1]) then
spell_damage = tabela [2] --damage taken by spell no tem PS, ento obrigado a passar o dano total
spell_damage = tabela[2] --damage taken by spell no tem PS, ento obrigado a passar o dano total
end
if (not bars_show_data [3]) then
if (not bars_show_data[3]) then
porcentagem = ""
else
porcentagem = porcentagem .. "%"
end
local bars_brackets = instance:GetBarBracket()
--
if (instance.use_multi_fontstrings) then
instance:SetInLineTexts(thisLine, "", (spell_damage and SelectedToKFunction(_, spell_damage) or ""), porcentagem)
else
@@ -995,7 +997,7 @@ end
if (colocacao == 1) then
thisLine:SetValue(100)
else
thisLine:SetValue(tabela [2] / instance.top * 100)
thisLine:SetValue(tabela[2] / instance.top * 100)
end
if (thisLine.hidden or thisLine.fading_in or thisLine.faded) then
@@ -1004,15 +1006,15 @@ end
if (instance.row_info.texture_class_colors) then
if (tabela [3] > 1) then
local r, g, b = Details:GetSpellSchoolColor (tabela [3])
local r, g, b = Details:GetSpellSchoolColor(tabela[3])
thisLine.textura:SetVertexColor(r, g, b)
else
local r, g, b = Details:GetSpellSchoolColor (0)
local r, g, b = Details:GetSpellSchoolColor(0)
thisLine.textura:SetVertexColor(r, g, b)
end
end
thisLine.icone_classe:SetTexture(spellicon)
thisLine.icone_classe:SetTexture(spellIcon)
thisLine.icone_classe:SetTexCoord(0.078125, 0.921875, 0.078125, 0.921875)
thisLine.icone_classe:SetVertexColor(1, 1, 1)
end
@@ -1081,7 +1083,7 @@ end
for i = 1, math.min (min, #damage_taken_table) do
local t = damage_taken_table [i]
GameCooltip:AddLine(Details:GetOnlyName(t[1]), FormatTooltipNumber (_, t[2]) .. " (" .. format ("%.1f", t[2] / total * 100) .. "%)")
GameCooltip:AddLine(Details:GetOnlyName(t[1]), FormatTooltipNumber (_, t[2]) .. " (" .. format("%.1f", t[2] / total * 100) .. "%)")
local classe = t[3]
if (not classe) then
classe = "UNKNOW"
@@ -1100,7 +1102,7 @@ end
end
end
local _, _, _, _, _, r, g, b = Details:GetClass (t[1])
local _, _, _, _, _, r, g, b = Details:GetClass(t[1])
GameCooltip:AddStatusBar (t[2] / top * 100, 1, r, g, b, 1, false, enemies_background)
end
else
@@ -1147,9 +1149,9 @@ end
local porcentagem
if (instancia.row_info.percent_type == 1) then
porcentagem = format ("%.1f", tabela [2] / total * 100)
porcentagem = format("%.1f", tabela [2] / total * 100)
elseif (instancia.row_info.percent_type == 2) then
porcentagem = format ("%.1f", tabela [2] / instancia.top * 100)
porcentagem = format("%.1f", tabela [2] / instancia.top * 100)
end
thisLine.lineText1:SetText(colocacao .. ". " .. tabela [1])
@@ -1189,7 +1191,7 @@ end
Details.FadeHandler.Fader(thisLine, "out")
end
Details:SetBarColors (thisLine, instancia, unpack(Details.class_colors [tabela [3]]))
Details:SetBarColors(thisLine, instancia, unpack(Details.class_colors [tabela [3]]))
if (tabela [3] == "UNKNOW" or tabela [3] == "UNGROUPPLAYER" or tabela [3] == "ENEMY") then
thisLine.icone_classe:SetTexture([[Interface\AddOns\Details\images\classes_plus]])
@@ -1278,7 +1280,7 @@ end
for index, t in ipairs(tooltip_void_zone_temp) do
instance_container:AddValue (t[4], t[2])
local custom_actor = instance_container:GetActorTable (t[4])
local custom_actor = instance_container:GetActorTable(t[4])
custom_actor.uptime = t[3].uptime
total = total + t[2]
@@ -1340,12 +1342,12 @@ end
}
local new_code = AVZ_search_code
new_code = new_code:gsub ("@ACTORNAME@", actor.nome)
new_code = new_code:gsub("@ACTORNAME@", actor.nome)
new_custom_object.script = new_code
local new_total_code = AVZ_total_code
new_total_code = new_total_code:gsub ("@ACTORNAME@", actor.nome)
new_total_code = new_total_code:gsub ("@SPELLID@", spellid)
new_total_code = new_total_code:gsub("@ACTORNAME@", actor.nome)
new_total_code = new_total_code:gsub("@SPELLID@", spellid)
new_custom_object.total_script = new_total_code
tinsert(Details.custom, new_custom_object)
@@ -1495,7 +1497,7 @@ end
GameCooltip:AddLine(Details:GetOnlyName(t[1]), FormatTooltipNumber (_, debuff_table.damage) .. " (" .. segundos .. "s" .. ")")
end
local classe = Details:GetClass (t[1])
local classe = Details:GetClass(t[1])
if (classe) then
local specID = Details:GetSpec (t[1])
if (specID) then
@@ -1508,7 +1510,7 @@ end
GameCooltip:AddIcon ("Interface\\LFGFRAME\\LFGROLE_BW", nil, nil, lineHeight, lineHeight, .25, .5, 0, 1)
end
local _, _, _, _, _, r, g, b = Details:GetClass (t[1])
local _, _, _, _, _, r, g, b = Details:GetClass(t[1])
if (first == 0) then
first = 0.0000000001
end
@@ -1531,9 +1533,8 @@ end
end
function atributo_misc:AtualizarVoidZone (whichRowLine, colocacao, instancia)
--pega a referncia da barra na janela
local thisLine = instancia.barras [whichRowLine]
local thisLine = instancia.barras[whichRowLine]
if (not thisLine) then
print("DEBUG: problema com <instancia.thisLine> "..whichRowLine.." "..rank)
@@ -1561,10 +1562,11 @@ end
if (instancia.row_info.percent_type == 1) then
total = max(total, 0.0001)
porcentagem = format ("%.1f", self.damage / total * 100)
porcentagem = format("%.1f", self.damage / total * 100)
elseif (instancia.row_info.percent_type == 2) then
local top = max(instancia.top, 0.0001)
porcentagem = format ("%.1f", self.damage / top * 100)
porcentagem = format("%.1f", self.damage / top * 100)
end
local bars_show_data = instancia.row_info.textR_show_data
@@ -1574,9 +1576,11 @@ end
if (not bars_show_data [1]) then
formated_damage = ""
end
if (not bars_show_data [2]) then
formated_dps = ""
end
if (not bars_show_data [3]) then
porcentagem = ""
else
@@ -1612,7 +1616,7 @@ end
school_color = Details.school_colors ["unknown"]
end
Details:SetBarColors (thisLine, instancia, unpack(school_color))
Details:SetBarColors(thisLine, instancia, unpack(school_color))
thisLine.icone_classe:SetTexture(icon)
thisLine.icone_classe:SetTexCoord(0.078125, 0.921875, 0.078125, 0.921875)
@@ -1621,7 +1625,6 @@ end
if (thisLine.mouse_over and not instancia.baseframe.isMoving) then
--need call a refresh function
end
end
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -1850,7 +1853,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta
this_spell [2] = this_spell [2] + on_player
total = total + on_player
else
error ("error - no spell id for DTBS " .. spellid)
error("error - no spell id for DTBS " .. spellid)
end
end
end
@@ -1885,7 +1888,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta
this_spell [2] = this_spell [2] + on_player
total = total + on_player
else
error ("error - no spell id for DTBS friendly fire " .. spellid)
error("error - no spell id for DTBS friendly fire " .. spellid)
end
end
end
@@ -1986,7 +1989,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta
local found = false
for spellid, spelltable in pairs(twin_damage_actor.spells._ActorTable) do
local name = _GetSpellInfo(spellid)
if (actor.damage_twin:find (name)) then
if (actor.damage_twin:find(name)) then
actor.damage = spelltable.total
voidzone_damage_total = voidzone_damage_total + spelltable.total
actor.damage_spellid = spellid
@@ -2317,9 +2320,7 @@ function atributo_damage:RefreshWindow (instancia, combatObject, forcar, exporta
end
elseif (instancia.bars_sort_direction == 2) then --bottom to top
if (useTotalBar and instancia.barraS[1] == 1) then
whichRowLine = 2
local iter_last = instancia.barraS[2]
if (iter_last == instancia.rows_fit_in_window) then
@@ -2600,19 +2601,19 @@ function atributo_damage:RefreshLine(instance, lineContainer, whichRowLine, rank
--calc the percent amount base on the percent type
if (percentage_type == 1) then
percentString = format ("%.1f", self [keyName] / total * 100)
percentString = format("%.1f", self[keyName] / total * 100)
elseif (percentage_type == 2) then
percentString = format ("%.1f", self [keyName] / instance.top * 100)
percentString = format("%.1f", self[keyName] / instance.top * 100)
end
--calculate the actor dps
if ((Details.time_type == 2 and self.grupo) or not Details:CaptureGet ("damage") or instance.segmento == -1) then
if ((Details.time_type == 2 and self.grupo) or not Details:CaptureGet("damage") or instance.segmento == -1) then
if (instance.segmento == -1 and combat_time == 0) then
local p = Details.tabela_vigente (1, self.nome)
if (p) then
local t = p:Tempo()
dps = damageTotal / t
local actor = Details.tabela_vigente(1, self.nome)
if (actor) then
local combatTime = actor:Tempo()
dps = damageTotal / combatTime
self.last_dps = dps
else
dps = damageTotal / combat_time
@@ -2646,9 +2647,11 @@ function atributo_damage:RefreshLine(instance, lineContainer, whichRowLine, rank
if (not bars_show_data [1]) then
formated_damage = ""
end
if (not bars_show_data [2]) then
formated_dps = ""
end
if (not bars_show_data [3]) then
percentString = ""
else
@@ -3198,7 +3201,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
local petActor = instancia.showing[class_type]:PegarCombatente (nil, petName)
if (petActor) then
for _spellid, _skill in pairs(petActor:GetActorSpells()) do
ActorSkillsSortTable [#ActorSkillsSortTable+1] = {_spellid, _skill.total, _skill.total/meu_tempo, petName:gsub ((" <.*"), "")}
ActorSkillsSortTable [#ActorSkillsSortTable+1] = {_spellid, _skill.total, _skill.total/meu_tempo, petName:gsub((" <.*"), "")}
end
end
end
@@ -3366,7 +3369,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
for spellid, tabela in pairs(tabela) do
local nome, rank, icone = _GetSpellInfo(spellid)
tinsert (meus_danos, {spellid, tabela.total, tabela.total/meu_total*100, {nome, rank, icone}})
tinsert(meus_danos, {spellid, tabela.total, tabela.total/meu_total*100, {nome, rank, icone}})
end
_table_sort(meus_danos, Details.Sort2)
danos [nome] = meus_danos
@@ -3374,7 +3377,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
local meus_inimigos = {}
tabela = my_self.targets
for target_name, amount in pairs(tabela) do
tinsert (meus_inimigos, {target_name, amount, amount/meu_total*100})
tinsert(meus_inimigos, {target_name, amount, amount/meu_total*100})
end
_table_sort(meus_inimigos,Details.Sort2)
alvos [nome] = meus_inimigos
@@ -3418,7 +3421,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
end
local n = _table [1]:gsub (("%s%<.*"), "")
local n = _table [1]:gsub(("%s%<.*"), "")
if (instancia.sub_atributo == 1) then
GameCooltip:AddLine(n, FormatTooltipNumber (_, _table [2]) .. " (" .. _math_floor(_table [2]/self.total*100) .. "%)")
else
@@ -3474,7 +3477,7 @@ function atributo_damage:ToolTip_DamageDone (instancia, numero, barra, keydown)
for i = 1, #playerPhases do
--[1] Phase Number [2] Amount Done [3] Rank [4] Percent
GameCooltip:AddLine("|cFFF0F0F0Phase|r " .. playerPhases [i][1], FormatTooltipNumber (_, playerPhases [i][2]) .. " (|cFFFFFF00#" .. playerPhases [i][3] .. "|r, " .. format ("%.1f", playerPhases [i][4]) .. "%)")
GameCooltip:AddLine("|cFFF0F0F0Phase|r " .. playerPhases [i][1], FormatTooltipNumber (_, playerPhases [i][2]) .. " (|cFFFFFF00#" .. playerPhases [i][3] .. "|r, " .. format("%.1f", playerPhases [i][4]) .. "%)")
GameCooltip:AddIcon ([[Interface\Garrison\orderhall-missions-mechanic9]], 1, 1, 14, 14, 11/64, 53/64, 11/64, 53/64)
Details:AddTooltipBackgroundStatusbar()
end
@@ -3496,7 +3499,7 @@ local on_switch_show_frags = function(instance)
end
local ENEMIES_format_name = function(player) if (player == 0) then return false end return Details:GetOnlyName(player.nome) end
local ENEMIES_format_amount = function(amount) if (amount <= 0) then return false end return Details:ToK(amount) .. " (" .. format ("%.1f", amount / tooltip_temp_table.damage_total * 100) .. "%)" end
local ENEMIES_format_amount = function(amount) if (amount <= 0) then return false end return Details:ToK(amount) .. " (" .. format("%.1f", amount / tooltip_temp_table.damage_total * 100) .. "%)" end
function atributo_damage:ReportEnemyDamageTaken (actor, instance, ShiftKeyDown, ControlKeyDown, fromFrags)
if (ShiftKeyDown) then
@@ -3544,7 +3547,7 @@ function atributo_damage:ReportEnemyDamageTaken (actor, instance, ShiftKeyDown,
end
local FRAGS_format_name = function(player_name) return Details:GetOnlyName(player_name) end
local FRAGS_format_amount = function(amount) return Details:ToK(amount) .. " (" .. format ("%.1f", amount / frags_tooltip_table.damage_total * 100) .. "%)" end
local FRAGS_format_amount = function(amount) return Details:ToK(amount) .. " (" .. format("%.1f", amount / frags_tooltip_table.damage_total * 100) .. "%)" end
function atributo_damage:ReportSingleFragsLine (frag, instance, ShiftKeyDown, ControlKeyDown)
@@ -3614,7 +3617,7 @@ function atributo_damage:ToolTip_Enemies (instancia, numero, barra, keydown)
local total = tooltip_temp_table [o][2]
local player_name = Details:GetOnlyName(player:name())
GameCooltip:AddLine(player_name .. " ", FormatTooltipNumber (_, total) .." (" .. format ("%.1f", (total / damage_taken) * 100) .. "%)")
GameCooltip:AddLine(player_name .. " ", FormatTooltipNumber (_, total) .." (" .. format("%.1f", (total / damage_taken) * 100) .. "%)")
local classe = player:class()
if (not classe) then
@@ -3792,14 +3795,14 @@ function atributo_damage:ToolTip_DamageTaken (instancia, numero, barra, keydown)
for _, spell in ipairs(all_spells) do
local spellname, _, spellicon = _GetSpellInfo(spell [1])
GameCooltip:AddLine(spellname .. " (|cFFFFFF00" .. spell [3] .. "|r)", FormatTooltipNumber (_, spell [2]).." (" .. format ("%.1f", (spell [2] / damage_taken) * 100).."%)")
GameCooltip:AddLine(spellname .. " (|cFFFFFF00" .. spell [3] .. "|r)", FormatTooltipNumber (_, spell [2]).." (" .. format("%.1f", (spell [2] / damage_taken) * 100).."%)")
GameCooltip:AddIcon (spellicon, 1, 1, icon_size.W, icon_size.H, icon_border.L, icon_border.R, icon_border.T, icon_border.B)
Details:AddTooltipBackgroundStatusbar()
end
else
local aggressorName = Details:GetOnlyName(meus_agressores[i][1])
if (ismaximized and meus_agressores[i][1]:find (Details.playername)) then
if (ismaximized and meus_agressores[i][1]:find(Details.playername)) then
GameCooltip:AddLine(aggressorName, FormatTooltipNumber (_, meus_agressores[i][2]).." ("..format("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)", nil, "yellow")
else
GameCooltip:AddLine(aggressorName, FormatTooltipNumber (_, meus_agressores[i][2]).." ("..format("%.1f", (meus_agressores[i][2]/damage_taken) * 100).."%)")
@@ -3971,16 +3974,18 @@ end
function atributo_damage:MontaDetalhes (spellid, barra, instancia)
if (info.sub_atributo == 1 or info.sub_atributo == 2) then
return self:MontaDetalhesDamageDone (spellid, barra, instancia)
elseif (info.sub_atributo == 3) then
return self:MontaDetalhesDamageTaken (spellid, barra, instancia)
elseif (info.sub_atributo == 4) then
return self:MontaDetalhesFriendlyFire (spellid, barra, instancia)
elseif (info.sub_atributo == 6) then
if (bitBand(self.flag_original, 0x00000400) ~= 0) then -- um jogador
return self:MontaDetalhesDamageDone (spellid, barra, instancia)
end
return self:MontaDetalhesEnemy (spellid, barra, instancia)
--return self:MontaDetalhesDamageDone (spellid, barra)
end
end
@@ -4003,7 +4008,7 @@ function atributo_damage:MontaInfoFriendlyFire()
local actor = combat (1, target_name)
if (actor) then
tinsert (DamagedPlayers, {target_name, ff_table.total, ff_table.total / FriendlyFireTotal * 100, actor.classe})
tinsert(DamagedPlayers, {target_name, ff_table.total, ff_table.total / FriendlyFireTotal * 100, actor.classe})
for spellid, amount in pairs(ff_table.spells) do
Skills [spellid] = (Skills [spellid] or 0) + amount
@@ -4023,14 +4028,14 @@ function atributo_damage:MontaInfoFriendlyFire()
if (not barra) then
barra = gump:CriaNovaBarraInfo1 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
barra.on_focus = false
end
if (not info.mostrando_mouse_over) then
if (tabela[1] == self.detalhes) then --tabela [1] = NOME = NOME que esta na caixa da direita
if (not barra.on_focus) then --se a barra no tiver no foco
barra.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1)
barra.textura:SetStatusBarColor(129/255, 125/255, 69/255, 1)
barra.on_focus = true
if (not info.mostrando) then
info.mostrando = barra
@@ -4038,7 +4043,7 @@ function atributo_damage:MontaInfoFriendlyFire()
end
else
if (barra.on_focus) then
barra.textura:SetStatusBarColor (1, 1, 1, 1) --volta a cor antiga
barra.textura:SetStatusBarColor(1, 1, 1, 1) --volta a cor antiga
barra:SetAlpha(.9) --volta a alfa antiga
barra.on_focus = false
end
@@ -4052,7 +4057,7 @@ function atributo_damage:MontaInfoFriendlyFire()
end
barra.lineText1:SetText(index .. instancia.divisores.colocacao .. Details:GetOnlyName(tabela[1])) --seta o texto da esqueda
barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " (" .. format ("%.1f", tabela[3]) .."%)") --seta o texto da direita
barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " (" .. format("%.1f", tabela[3]) .."%)") --seta o texto da direita
local classe = tabela[4]
if (not classe) then
@@ -4069,9 +4074,9 @@ function atributo_damage:MontaInfoFriendlyFire()
local color = Details.class_colors [classe]
if (color) then
barra.textura:SetStatusBarColor (unpack(color))
barra.textura:SetStatusBarColor(unpack(color))
else
barra.textura:SetStatusBarColor (1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1)
end
barra.minha_tabela = self
@@ -4105,7 +4110,7 @@ function atributo_damage:MontaInfoFriendlyFire()
if (not barra) then
barra = gump:CriaNovaBarraInfo2 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
end
if (index == 1) then
@@ -4168,7 +4173,7 @@ function atributo_damage:MontaInfoDamageTaken()
barra = gump:CriaNovaBarraInfo1 (instancia, index)
end
self:FocusLock (barra, tabela[1])
self:FocusLock(barra, tabela[1])
local texCoords = Details.class_coords [tabela[4]]
if (not texCoords) then
@@ -4176,23 +4181,22 @@ function atributo_damage:MontaInfoDamageTaken()
end
local formated_value = SelectedToKFunction(_, _math_floor(tabela[2]))
self:UpdadeInfoBar (barra, index, tabela[1], tabela[1], tabela[2], formated_value, max_, tabela[3], "Interface\\AddOns\\Details\\images\\classes_small_alpha", true, texCoords, nil, tabela[4])
self:UpdadeInfoBar(barra, index, tabela[1], tabela[1], tabela[2], formated_value, max_, tabela[3], "Interface\\AddOns\\Details\\images\\classes_small_alpha", true, texCoords, nil, tabela[4])
end
end
--[[exported]] function Details:UpdadeInfoBar (row, index, spellid, name, value, value_formated, max, percent, icon, detalhes, texCoords, spellschool, class)
--seta o tamanho da barra
--[[exported]] function Details:UpdadeInfoBar(row, index, spellId, name, value, formattedValue, max, percent, icon, detalhes, texCoords, spellSchool, class)
if (index == 1) then
row.textura:SetValue(100)
else
max = math.max(max, 0.001)
row.textura:SetValue(value/max*100)
row.textura:SetValue(value / max * 100)
end
if (type(index) == "number") then
if (debugmode) then
row.lineText1:SetText(index .. ". " .. name .. " (" .. spellid .. ")")
row.lineText1:SetText(index .. ". " .. name .. " (" .. spellId .. ")")
else
row.lineText1:SetText(index .. ". " .. name)
end
@@ -4202,13 +4206,12 @@ end
row.lineText1.text = row.lineText1:GetText()
if (value_formated) then
row.lineText4:SetText(value_formated .. " (" .. format ("%.1f", percent) .."%)")
if (formattedValue) then
row.lineText4:SetText(formattedValue .. " (" .. format("%.1f", percent) .."%)")
end
row.lineText1:SetSize(row:GetWidth() - row.lineText4:GetStringWidth() - 40, 15)
--seta o icone
if (icon) then
row.icone:SetTexture(icon)
if (icon == "Interface\\AddOns\\Details\\images\\classes_small") then
@@ -4230,48 +4233,48 @@ end
if (texCoords) then
row.icone:SetTexCoord(unpack(texCoords))
else
local icon_border = Details.tooltip.icon_border_texcoord
row.icone:SetTexCoord(icon_border.L, icon_border.R, icon_border.T, icon_border.B)
local iconBorder = Details.tooltip.icon_border_texcoord
row.icone:SetTexCoord(iconBorder.L, iconBorder.R, iconBorder.T, iconBorder.B)
end
row.minha_tabela = self
row.show = spellid
row:Show() --mostra a barra
row.show = spellId
row:Show()
if (spellschool) then
local t = Details.spells_school [spellschool]
if (t and t.decimals) then
row.textura:SetStatusBarColor (t.decimals[1], t.decimals[2], t.decimals[3])
if (spellSchool) then
local schoolColor = Details.spells_school[spellSchool]
if (schoolColor and schoolColor.decimals) then
row.textura:SetStatusBarColor(schoolColor.decimals[1], schoolColor.decimals[2], schoolColor.decimals[3])
else
row.textura:SetStatusBarColor (1, 1, 1)
row.textura:SetStatusBarColor(1, 1, 1)
end
elseif (class) then
local color = Details.class_colors [class]
local color = Details.class_colors[class]
if (color) then
row.textura:SetStatusBarColor (unpack(color))
row.textura:SetStatusBarColor(unpack(color))
else
row.textura:SetStatusBarColor (1, 1, 1)
row.textura:SetStatusBarColor(1, 1, 1)
end
else
if (spellid == 98021) then --spirit linkl
row.textura:SetStatusBarColor (1, 0.4, 0.4)
if (spellId == 98021) then --spirit linkl
row.textura:SetStatusBarColor(1, 0.4, 0.4)
else
row.textura:SetStatusBarColor (1, 1, 1)
row.textura:SetStatusBarColor(1, 1, 1)
end
end
if (detalhes and self.detalhes and self.detalhes == spellid and info.showing == index) then
--self:MontaDetalhes (spellid, row) --poderia deixar isso pro final e montar uma tail call??
self:MontaDetalhes (row.show, row, info.instancia) --poderia deixar isso pro final e montar uma tail call??
if (detalhes and self.detalhes and self.detalhes == spellId and info.showing == index) then
self:MontaDetalhes(row.show, row, info.instancia)
end
end
--[[exported]] function Details:FocusLock (row, spellid)
--lock into a line after clicking on it
--[[exported]] function Details:FocusLock(row, spellId)
if (not info.mostrando_mouse_over) then
if (spellid == self.detalhes) then --tabela [1] = spellid = spellid que esta na caixa da direita
if (spellId == self.detalhes) then --tabela [1] = spellid = spellid que esta na caixa da direita
if (not row.on_focus) then --se a barra no tiver no foco
row.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1)
row.textura:SetStatusBarColor(129/255, 125/255, 69/255, 1)
row.on_focus = true
if (not info.mostrando) then
info.mostrando = row
@@ -4279,7 +4282,7 @@ end
end
else
if (row.on_focus) then
row.textura:SetStatusBarColor (1, 1, 1, 1) --volta a cor antiga
row.textura:SetStatusBarColor(1, 1, 1, 1) --volta a cor antiga
row:SetAlpha(.9) --volta a alfa antiga
row.on_focus = false
end
@@ -4289,34 +4292,34 @@ end
------ Damage Done & Dps
function atributo_damage:MontaInfoDamageDone()
local allLines = info.barras1
local instance = info.instancia
local totalDamageWithoutPet = self.total_without_pet --total de dano aplicado por este jogador
local barras = info.barras1
local instancia = info.instancia
local total = self.total_without_pet --total de dano aplicado por este jogador
local ActorTotalDamage = self.total
local ActorSkillsSortTable = {}
local ActorSkillsContainer = self.spells._ActorTable
local actorTotalDamage = self.total
local actorSkillsSortTable = {}
local actorSkillsContainer = self.spells._ActorTable
--get time type
local meu_tempo
local actorCombatTime
if (Details.time_type == 1 or not self.grupo) then
meu_tempo = self:Tempo()
actorCombatTime = self:Tempo()
elseif (Details.time_type == 2) then
meu_tempo = info.instancia.showing:GetCombatTime()
actorCombatTime = info.instancia.showing:GetCombatTime()
end
for _spellid, _skill in pairs(ActorSkillsContainer) do --da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo(_spellid)
for spellId, spellTable in pairs(actorSkillsContainer) do --da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo(spellId)
if (nome) then
tinsert (ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome, icone, nil, _skill.spellschool})
tinsert(actorSkillsSortTable, {spellId, spellTable.total, spellTable.total/actorTotalDamage*100, nome, icone, nil, spellTable.spellschool})
end
end
--damage rank
local combat = instancia:GetShowingCombat()
local combat = instance:GetShowingCombat()
local diff = combat:GetDifficulty()
local attribute, subattribute = instancia:GetDisplay()
local attribute, subAttribute = instance:GetDisplay()
--check if is a raid encounter and if is heroic or mythic
if (diff and (diff == 15 or diff == 16)) then
@@ -4326,7 +4329,7 @@ function atributo_damage:MontaInfoDamageDone()
if (bestRank) then
--discover which are the player position in the guild rank
local playerTable, onEncounter, rankPosition = Details.storage:GetPlayerGuildRank (diff, combat:GetBossInfo().id, "damage", self.nome, true)
local text1 = self.nome .. " Guild Rank on " .. (combat:GetBossInfo().name or "") .. ": |cFFFFFF00" .. (rankPosition or "x") .. "|r Best Dps: |cFFFFFF00" .. Details:ToK2((bestRank[1] or 0) / encounterTable.elapsed) .. "|r (" .. encounterTable.date:gsub (".*%s", "") .. ")"
local text1 = self.nome .. " Guild Rank on " .. (combat:GetBossInfo().name or "") .. ": |cFFFFFF00" .. (rankPosition or "x") .. "|r Best Dps: |cFFFFFF00" .. Details:ToK2((bestRank[1] or 0) / encounterTable.elapsed) .. "|r (" .. encounterTable.date:gsub(".*%s", "") .. ")"
info:SetStatusbarText (text1, 10, "gray")
else
info:SetStatusbarText()
@@ -4344,45 +4347,45 @@ function atributo_damage:MontaInfoDamageDone()
local class_color = "FFCCBBBB"
--local class_color = "FFDDDD44"
for _, PetName in ipairs(ActorPets) do
local PetActor = instancia.showing (class_type, PetName)
local PetActor = instance.showing (class_type, PetName)
if (PetActor) then
local PetSkillsContainer = PetActor.spells._ActorTable
for _spellid, _skill in pairs(PetSkillsContainer) do --da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo(_spellid)
--tinsert (ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome .. " |TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:33:64:96:128|t|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r", icone, PetActor, _skill.spellschool})
--tinsert(ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome .. " |TInterface\\AddOns\\Details\\images\\classes_small_alpha:12:12:0:0:128:128:33:64:96:128|t|c" .. class_color .. PetName:gsub((" <.*"), "") .. "|r", icone, PetActor, _skill.spellschool})
if (nome) then
tinsert (ActorSkillsSortTable, {_spellid, _skill.total, _skill.total/ActorTotalDamage*100, nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)", icone, PetActor, _skill.spellschool})
tinsert(actorSkillsSortTable, {_spellid, _skill.total, _skill.total/actorTotalDamage*100, nome .. " (|c" .. class_color .. PetName:gsub((" <.*"), "") .. "|r)", icone, PetActor, _skill.spellschool})
end
end
end
end
_table_sort(ActorSkillsSortTable, Details.Sort2)
_table_sort(actorSkillsSortTable, Details.Sort2)
gump:JI_AtualizaContainerBarras (#ActorSkillsSortTable + 1)
gump:JI_AtualizaContainerBarras (#actorSkillsSortTable + 1)
local max_ = ActorSkillsSortTable[1] and ActorSkillsSortTable[1][2] or 0 --dano que a primeiro magia vez
local max_ = actorSkillsSortTable[1] and actorSkillsSortTable[1][2] or 0 --dano que a primeiro magia vez
local barra
--aura bar
if (false) then --disabled for now
barra = barras [1]
barra = allLines [1]
if (not barra) then
barra = gump:CriaNovaBarraInfo1 (instancia, 1)
barra = gump:CriaNovaBarraInfo1 (instance, 1)
end
self:UpdadeInfoBar (barra, "", -51, "Auras", max_, false, max_, 100, [[Interface\BUTTONS\UI-GroupLoot-DE-Up]], true, nil, nil)
barra.textura:SetStatusBarColor (Details.gump:ParseColors("purple"))
self:UpdadeInfoBar(barra, "", -51, "Auras", max_, false, max_, 100, [[Interface\BUTTONS\UI-GroupLoot-DE-Up]], true, nil, nil)
barra.textura:SetStatusBarColor(Details.gump:ParseColors("purple"))
end
--spell bars
for index, tabela in ipairs(ActorSkillsSortTable) do
for index, tabela in ipairs(actorSkillsSortTable) do
--index = index + 1 --with the aura bar
index = index
barra = barras [index]
barra = allLines [index]
if (not barra) then
barra = gump:CriaNovaBarraInfo1 (instancia, index)
barra = gump:CriaNovaBarraInfo1 (instance, index)
end
barra.other_actor = tabela [6]
@@ -4390,22 +4393,22 @@ function atributo_damage:MontaInfoDamageDone()
local name = tabela[4]
if (info.sub_atributo == 2) then
local formated_value = SelectedToKFunction(_, _math_floor(tabela[2]/meu_tempo))
self:UpdadeInfoBar (barra, index, tabela[1], name, tabela[2], formated_value, max_, tabela[3], tabela[5], true, nil, tabela [7])
local formated_value = SelectedToKFunction(_, _math_floor(tabela[2]/actorCombatTime))
self:UpdadeInfoBar(barra, index, tabela[1], name, tabela[2], formated_value, max_, tabela[3], tabela[5], true, nil, tabela [7])
else
local formated_value = SelectedToKFunction(_, _math_floor(tabela[2]))
self:UpdadeInfoBar (barra, index, tabela[1], name, tabela[2], formated_value, max_, tabela[3], tabela[5], true, nil, tabela [7])
self:UpdadeInfoBar(barra, index, tabela[1], name, tabela[2], formated_value, max_, tabela[3], tabela[5], true, nil, tabela [7])
end
self:FocusLock (barra, tabela[1])
self:FocusLock(barra, tabela[1])
end
--TOP INIMIGOS
if (instancia.sub_atributo == 6) then
if (instance.sub_atributo == 6) then
local damage_taken = self.damage_taken
local agressores = self.damage_from
local tabela_do_combate = instancia.showing
local tabela_do_combate = instance.showing
local showing = tabela_do_combate [class_type] --o que esta sendo mostrado -> [1] - dano [2] - cura --pega o container com ._NameIndexTable ._ActorTable
local barras = info.barras2
local meus_agressores = {}
@@ -4439,8 +4442,8 @@ function atributo_damage:MontaInfoDamageDone()
barra = barras [index]
if (not barra) then --se a barra no existir, criar ela ento
barra = gump:CriaNovaBarraInfo2 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
barra = gump:CriaNovaBarraInfo2 (instance, index)
barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
end
if (index == 1) then
@@ -4450,7 +4453,7 @@ function atributo_damage:MontaInfoDamageDone()
end
barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName(tabela[1])) --seta o texto da esqueda
barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " (" .. format ("%.1f", tabela[3]) .. "%)") --seta o texto da direita
barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " (" .. format("%.1f", tabela[3]) .. "%)") --seta o texto da direita
barra.icone:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) --CLASSE
@@ -4462,9 +4465,9 @@ function atributo_damage:MontaInfoDamageDone()
local color = Details.class_colors [tabela[4]]
if (color) then
barra.textura:SetStatusBarColor (unpack(color))
barra.textura:SetStatusBarColor(unpack(color))
else
barra.textura:SetStatusBarColor (1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1)
end
Details:name_space_info (barra)
@@ -4494,7 +4497,7 @@ function atributo_damage:MontaInfoDamageDone()
--my target container
conteudo = self.targets
for target_name, amount in pairs(conteudo) do
tinsert (meus_inimigos, {target_name, amount, amount/total*100})
tinsert(meus_inimigos, {target_name, amount, amount/totalDamageWithoutPet*100})
end
--sort
@@ -4515,8 +4518,8 @@ function atributo_damage:MontaInfoDamageDone()
barra = info.barras2 [index]
if (not barra) then
barra = gump:CriaNovaBarraInfo2 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra = gump:CriaNovaBarraInfo2 (instance, index)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
end
if (index == 1) then
@@ -4525,31 +4528,31 @@ function atributo_damage:MontaInfoDamageDone()
barra.textura:SetValue(tabela[2]/max_inimigos*100)
end
local target_actor = instancia.showing (1, tabela[1])
local target_actor = instance.showing (1, tabela[1])
if (target_actor) then
target_actor:SetClassIcon(barra.icone, instancia, target_actor.classe)
target_actor:SetClassIcon(barra.icone, instance, target_actor.classe)
else
barra.icone:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) --CLASSE
local texCoords = Details.class_coords ["ENEMY"]
barra.icone:SetTexCoord(unpack(texCoords))
end
barra.textura:SetStatusBarColor (1, 0.8, 0.8)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 0.8, 0.8)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
barra.lineText1:SetText(index .. ". " .. Details:GetOnlyName(tabela[1]))
if (info.sub_atributo == 2) then
barra.lineText4:SetText(Details:comma_value ( _math_floor(tabela[2]/meu_tempo)) .. " (" .. format ("%.1f", tabela[3]) .. "%)")
barra.lineText4:SetText(Details:comma_value ( _math_floor(tabela[2]/actorCombatTime)) .. " (" .. format("%.1f", tabela[3]) .. "%)")
else
barra.lineText4:SetText(SelectedToKFunction(_, tabela[2]) .." (" .. format ("%.1f", tabela[3]) .. "%)")
barra.lineText4:SetText(SelectedToKFunction(_, tabela[2]) .." (" .. format("%.1f", tabela[3]) .. "%)")
end
if (barra.mouse_over) then --atualizar o tooltip
if (barra.isAlvo) then
--GameTooltip:Hide()
--GameTooltip:SetOwner(barra, "ANCHOR_TOPRIGHT")
if (not barra.minha_tabela:MontaTooltipAlvos (barra, index, instancia)) then
if (not barra.minha_tabela:MontaTooltipAlvos (barra, index, instance)) then
return
end
--GameTooltip:Show()
@@ -4592,7 +4595,7 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra)
for spellid, amount in pairs(ff_table.spells) do --da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo(spellid)
tinsert (minhas_magias, {spellid, amount, amount / total * 100, nome, icone})
tinsert(minhas_magias, {spellid, amount, amount / total * 100, nome, icone})
end
_table_sort(minhas_magias, Details.Sort2)
@@ -4605,7 +4608,7 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra)
if (not barra) then --se a barra no existir, criar ela ento
barra = gump:CriaNovaBarraInfo3 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
end
if (index == 1) then
@@ -4615,7 +4618,7 @@ function atributo_damage:MontaDetalhesFriendlyFire (nome, barra)
end
barra.lineText1:SetText(index..instancia.divisores.colocacao..tabela[4]) --seta o texto da esqueda
barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " " .. instancia.divisores.abre .. format ("%.1f", tabela[3]) .. "%" .. instancia.divisores.fecha) --seta o texto da direita
barra.lineText4:SetText(Details:comma_value (tabela[2]) .. " " .. instancia.divisores.abre .. format("%.1f", tabela[3]) .. "%" .. instancia.divisores.fecha) --seta o texto da direita
barra.icone:SetTexture(tabela[5])
barra.icone:SetTexCoord(0, 1, 0, 1)
@@ -4680,7 +4683,7 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra)
if (not barra) then --se a barra no existir, criar ela ento
barra = gump:CriaNovaBarraInfo3 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
end
if (index == 1) then
@@ -4705,9 +4708,9 @@ function atributo_damage:MontaDetalhesEnemy (spellid, barra)
local color = Details.class_colors [tabela[3]]
if (color) then
barra.textura:SetStatusBarColor (unpack(color))
barra.textura:SetStatusBarColor(unpack(color))
else
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
end
barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small_alpha")
@@ -4753,7 +4756,7 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra)
local este_alvo = tabela.targets [actor]
if (este_alvo) then --esta magia deu dano no actor
local spell_nome, rank, icone = _GetSpellInfo(spellid)
tinsert (minhas_magias, {spellid, este_alvo, este_alvo/total*100, spell_nome, icone})
tinsert(minhas_magias, {spellid, este_alvo, este_alvo/total*100, spell_nome, icone})
end
end
@@ -4770,7 +4773,7 @@ function atributo_damage:MontaDetalhesDamageTaken (nome, barra)
if (not barra) then --se a barra no existir, criar ela ento
barra = gump:CriaNovaBarraInfo3 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
end
if (index == 1) then
@@ -4893,11 +4896,11 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia)
local index = 1
local data = data_table
table.wipe (t1)
table.wipe (t2)
table.wipe (t3)
table.wipe (t4)
table.wipe (data)
table.wipe(t1)
table.wipe(t2)
table.wipe(t3)
table.wipe(t4)
table.wipe(data)
--GERAL
local media = 0
@@ -4982,7 +4985,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia)
t1[5] = Loc ["STRING_MAXIMUM_SHORT"] .. ": " .. Details:comma_value (esta_magia.n_max)
t1[6] = Loc ["STRING_AVERAGE"] .. ": " .. Details:comma_value (media_normal)
t1[7] = Loc ["STRING_DPS"] .. ": " .. Details:comma_value (normal_dmg/T)
t1[8] = normal_hits .. " [|cFFC0C0C0" .. format ("%.1f", normal_hits/max(total_hits, 0.0001)*100) .. "%|r]"
t1[8] = normal_hits .. " [|cFFC0C0C0" .. format("%.1f", normal_hits/max(total_hits, 0.0001)*100) .. "%|r]"
end
@@ -5008,7 +5011,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia)
t2[5] = Loc ["STRING_MAXIMUM_SHORT"] .. ": " .. Details:comma_value (esta_magia.c_max)
t2[6] = Loc ["STRING_AVERAGE"] .. ": " .. Details:comma_value (media_critico)
t2[7] = Loc ["STRING_DPS"] .. ": " .. Details:comma_value (crit_dps)
t2[8] = esta_magia.c_amt .. " [|cFFC0C0C0" .. format ("%.1f", esta_magia.c_amt/total_hits*100) .. "%|r]"
t2[8] = esta_magia.c_amt .. " [|cFFC0C0C0" .. format("%.1f", esta_magia.c_amt/total_hits*100) .. "%|r]"
end
@@ -5032,7 +5035,7 @@ function atributo_damage:MontaDetalhesDamageDone (spellid, barra, instancia)
t3[5] = Loc ["STRING_PARRY"] .. ": " .. parry
t3[6] = Loc ["STRING_DODGE"] .. ": " .. dodge
t3[7] = Loc ["STRING_BLOCKED"] .. ": " .. _math_floor(esta_magia.b_amt/esta_magia.counter*100)
t3[8] = (outros_desvios+erros) .. " / " .. format ("%.1f", porcentagem_defesas) .. "%"
t3[8] = (outros_desvios+erros) .. " / " .. format("%.1f", porcentagem_defesas) .. "%"
end
@@ -5065,7 +5068,7 @@ function Details:BuildPlayerDetailsSpellChart()
for i = 1, 200 do
local texture = playerDetailSmallChart:CreateTexture(nil, "artwork")
texture:SetColorTexture (1, 1, 1, 1)
texture:SetColorTexture(1, 1, 1, 1)
tinsert(playerDetailSmallChart.Lines, texture)
end
@@ -5238,7 +5241,7 @@ function atributo_damage:MontaTooltipAlvos (thisLine, index, instancia)
end
local nome, _, icone = _GetSpellInfo(_spellid)
t[1], t[2], t[3] = nome .. " (" .. PetName:gsub ((" <.*"), "") .. ")", amount, icone
t[1], t[2], t[3] = nome .. " (" .. PetName:gsub((" <.*"), "") .. ")", amount, icone
i = i + 1
end
@@ -5932,7 +5935,7 @@ end
local total = tooltip_temp_table [o][2]
local player_name = player:name()
if (player_name:find (Details.playername)) then
if (player_name:find(Details.playername)) then
GameCooltip:AddLine(player_name .. ": ", FormatTooltipNumber (_, total) .. " (" .. _cstr ("%.1f", (total / damage_done) * 100) .. "%)", 2, "yellow")
else
GameCooltip:AddLine(player_name .. ": ", FormatTooltipNumber (_, total) .." (" .. _cstr ("%.1f", (total / damage_done) * 100) .. "%)", 2)
+1 -1
View File
@@ -7,7 +7,7 @@ do
}
_error.__index = _error
_error.__newindex = function()
assert (false, "Attempt to modify an read-only object.\nUse object() or object.errortext\n"..debugstack (2, 1 , 0))
assert(false, "Attempt to modify an read-only object.\nUse object() or object.errortext\n"..debugstack (2, 1 , 0))
return
end
_error.__tostring = function()
+43 -43
View File
@@ -180,7 +180,7 @@ function atributo_heal:ContainerRefreshHps (container, combat_time)
local total = 0
if (_detalhes.time_type == 2 or not _detalhes:CaptureGet ("heal")) then
if (_detalhes.time_type == 2 or not _detalhes:CaptureGet("heal")) then
for _, actor in ipairs(container) do
if (actor.grupo) then
actor.last_hps = actor.total / combat_time
@@ -206,7 +206,7 @@ function atributo_heal:ReportSingleDamagePreventedLine (actor, instancia)
for i = 2, GameCooltip:GetNumLines()-2 do
local texto_left, texto_right = GameCooltip:GetText (i)
if (texto_left and texto_right) then
texto_left = texto_left:gsub (("|T(.*)|t "), "")
texto_left = texto_left:gsub(("|T(.*)|t "), "")
reportar [#reportar+1] = ""..texto_left.." "..texto_right..""
end
end
@@ -448,7 +448,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo
row1.textura:SetVertexColor(r, g, b)
row1.icone_classe:SetTexture(instancia.total_bar.icon)
row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375)
row1.icone_classe:SetTexCoord(0.0625, 0.9375, 0.0625, 0.9375)
Details.FadeHandler.Fader(row1, "out")
@@ -518,7 +518,7 @@ function atributo_heal:RefreshWindow (instancia, tabela_do_combate, forcar, expo
row1.textura:SetVertexColor(r, g, b)
row1.icone_classe:SetTexture(instancia.total_bar.icon)
row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375)
row1.icone_classe:SetTexCoord(0.0625, 0.9375, 0.0625, 0.9375)
Details.FadeHandler.Fader(row1, "out")
@@ -626,7 +626,7 @@ function atributo_heal:RefreshLine(instancia, barras_container, whichRowLine, lu
porcentagem = _cstr ("%.1f", self [keyName] / instancia.top * 100)
end
if ((_detalhes.time_type == 2 and self.grupo) or (not _detalhes:CaptureGet ("heal") and not _detalhes:CaptureGet ("aura")) or instancia.segmento == -1) then
if ((_detalhes.time_type == 2 and self.grupo) or (not _detalhes:CaptureGet("heal") and not _detalhes:CaptureGet("aura")) or instancia.segmento == -1) then
if (instancia.segmento == -1 and combat_time == 0) then
local p = _detalhes.tabela_vigente(2, self.nome)
if (p) then
@@ -886,7 +886,7 @@ function atributo_heal:RefreshBarra2 (thisLine, instancia, tabela_anterior, forc
Details.FadeHandler.Fader(thisLine, "out")
end
return self:RefreshBarra (thisLine, instancia)
return self:RefreshBarra(thisLine, instancia)
else
return
end
@@ -910,7 +910,7 @@ function atributo_heal:RefreshBarra2 (thisLine, instancia, tabela_anterior, forc
thisLine.background:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b)
end
return self:RefreshBarra (thisLine, instancia)
return self:RefreshBarra(thisLine, instancia)
else
--agora esta comparando se a tabela da barra diferente da tabela na atualizao anterior
@@ -925,7 +925,7 @@ function atributo_heal:RefreshBarra2 (thisLine, instancia, tabela_anterior, forc
thisLine.last_value = esta_porcentagem --reseta o ultimo valor da barra
return self:RefreshBarra (thisLine, instancia)
return self:RefreshBarra(thisLine, instancia)
elseif (esta_porcentagem ~= thisLine.last_value) then --continua mostrando a mesma tabela ento compara a porcentagem
--apenas atualizar
@@ -936,7 +936,7 @@ function atributo_heal:RefreshBarra2 (thisLine, instancia, tabela_anterior, forc
end
thisLine.last_value = esta_porcentagem
return self:RefreshBarra (thisLine, instancia)
return self:RefreshBarra(thisLine, instancia)
end
end
@@ -944,7 +944,7 @@ function atributo_heal:RefreshBarra2 (thisLine, instancia, tabela_anterior, forc
end
function atributo_heal:RefreshBarra (thisLine, instancia, from_resize)
function atributo_heal:RefreshBarra(thisLine, instancia, from_resize)
local class, enemy, arena_enemy, arena_ally = self.classe, self.enemy, self.arena_enemy, self.arena_ally
@@ -955,7 +955,7 @@ function atributo_heal:RefreshBarra (thisLine, instancia, from_resize)
--icon
self:SetClassIcon (thisLine.icone_classe, instancia, class)
--texture color
self:SetBarColors (thisLine, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b)
self:SetBarColors(thisLine, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b)
--left text
self:SetBarLeftText (thisLine, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText)
@@ -1340,7 +1340,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
for _spellid, _skill in pairs(ActorSkillsContainer) do
local SkillName, _, SkillIcon = _GetSpellInfo(_spellid)
if (_skill [skill_key] > 0 or _skill.anti_heal) then
tinsert (ActorHealingTable, {
tinsert(ActorHealingTable, {
_spellid,
_skill [skill_key],
_skill [skill_key]/ActorTotal*100,
@@ -1360,7 +1360,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
for _spellid, _skill in pairs(petActor:GetActorSpells()) do
if (_skill [skill_key] > 0) then
local SkillName, _, SkillIcon = _GetSpellInfo(_spellid)
local petName = petName:gsub ((" <.*"), "")
local petName = petName:gsub((" <.*"), "")
ActorHealingTable [#ActorHealingTable+1] = {
_spellid,
_skill [skill_key],
@@ -1387,7 +1387,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
target_name = Translit:Transliterate(target_name, "!")
end
tinsert (ActorHealingTargets, {target_name, amount, amount / ActorTotal * 100})
tinsert(ActorHealingTargets, {target_name, amount, amount / ActorTotal * 100})
end
end
_table_sort (ActorHealingTargets, _detalhes.Sort2)
@@ -1506,7 +1506,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
break
end
if (ismaximized and ActorHealingTargets[i][1]:find (_detalhes.playername)) then
if (ismaximized and ActorHealingTargets[i][1]:find(_detalhes.playername)) then
GameCooltip:AddLine(ActorHealingTargets[i][1], FormatTooltipNumber (_, ActorHealingTargets[i][2]) .." (".._cstr ("%.1f", ActorHealingTargets[i][3]).."%)", nil, "yellow")
GameCooltip:AddStatusBar (100, 1, .5, .5, .5, .7)
else
@@ -1593,7 +1593,7 @@ function atributo_heal:ToolTip_HealingDone (instancia, numero, barra, keydown)
end
local n = _table [1]:gsub (("%s%<.*"), "")
local n = _table [1]:gsub(("%s%<.*"), "")
if (instancia.sub_atributo == 3) then --overheal
GameCooltip:AddLine(n .. " (|cFFFF3333" .. _math_floor( (_table [2] / (_table [2] + _table [3])) * 100) .. "%|r):", FormatTooltipNumber (_, _math_floor(_table [2])) .. " (" .. _math_floor( (_table [2] / (_table [2] + _table [3])) * 100) .. "%)")
@@ -1713,9 +1713,9 @@ function atributo_heal:MontaInfoHealTaken()
barra = gump:CriaNovaBarraInfo1 (instancia, index)
end
self:FocusLock (barra, tabela[1])
self:FocusLock(barra, tabela[1])
--hes:UpdadeInfoBar (row, index, spellid, name, value, max, percent, icon, detalhes)
--hes:UpdadeInfoBar(row, index, spellid, name, value, max, percent, icon, detalhes)
local texCoords = CLASS_ICON_TCOORDS [tabela[4]]
if (not texCoords) then
@@ -1723,7 +1723,7 @@ function atributo_heal:MontaInfoHealTaken()
end
local formated_value = SelectedToKFunction (_, _math_floor(tabela[2]))
self:UpdadeInfoBar (barra, index, tabela[1], tabela[1], tabela[2], formated_value, max_, tabela[3], "Interface\\AddOns\\Details\\images\\classes_small", true, texCoords)
self:UpdadeInfoBar(barra, index, tabela[1], tabela[1], tabela[2], formated_value, max_, tabela[3], "Interface\\AddOns\\Details\\images\\classes_small", true, texCoords)
end
end
@@ -1739,7 +1739,7 @@ function atributo_heal:MontaInfoOverHealing()
for spellid, tabela in pairs(tabela) do
local nome, _, icone = _GetSpellInfo(spellid)
tinsert (minhas_curas, {spellid, tabela.overheal, tabela.overheal/total*100, nome, icone})
tinsert(minhas_curas, {spellid, tabela.overheal, tabela.overheal/total*100, nome, icone})
end
--add pets
@@ -1751,7 +1751,7 @@ function atributo_heal:MontaInfoOverHealing()
local PetSkillsContainer = PetActor.spells._ActorTable
for _spellid, _skill in pairs(PetSkillsContainer) do --da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo(_spellid)
tinsert (minhas_curas, {_spellid, _skill.overheal, _skill.overheal/total*100, nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)", icone, PetActor})
tinsert(minhas_curas, {_spellid, _skill.overheal, _skill.overheal/total*100, nome .. " (|c" .. class_color .. PetName:gsub((" <.*"), "") .. "|r)", icone, PetActor})
end
end
end
@@ -1769,14 +1769,14 @@ function atributo_heal:MontaInfoOverHealing()
if (not barra) then
barra = gump:CriaNovaBarraInfo1 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
barra.on_focus = false
end
if (not info.mostrando_mouse_over) then
if (tabela[1] == self.detalhes) then --tabela [1] = spellid = spellid que esta na caixa da direita
if (not barra.on_focus) then --se a barra no tiver no foco
barra.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1)
barra.textura:SetStatusBarColor(129/255, 125/255, 69/255, 1)
barra.on_focus = true
if (not info.mostrando) then
info.mostrando = barra
@@ -1784,7 +1784,7 @@ function atributo_heal:MontaInfoOverHealing()
end
else
if (barra.on_focus) then
barra.textura:SetStatusBarColor (1, 1, 1, 1) --volta a cor antiga
barra.textura:SetStatusBarColor(1, 1, 1, 1) --volta a cor antiga
barra:SetAlpha(.9) --volta a alfa antiga
barra.on_focus = false
end
@@ -1824,7 +1824,7 @@ function atributo_heal:MontaInfoOverHealing()
if (actor_object) then
classe = actor_object.classe
end
tinsert (jogadores_overhealed, {target_name, amount, amount/total*100, classe})
tinsert(jogadores_overhealed, {target_name, amount, amount/total*100, classe})
end
_table_sort (jogadores_overhealed, _detalhes.Sort2)
@@ -1839,7 +1839,7 @@ function atributo_heal:MontaInfoOverHealing()
if (not barra) then
barra = gump:CriaNovaBarraInfo2 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
end
if (index == 1) then
@@ -1859,7 +1859,7 @@ function atributo_heal:MontaInfoOverHealing()
if (not texCoords) then
texCoords = _detalhes.class_coords ["UNKNOW"]
end
barra.icone:SetTexCoord (_unpack(texCoords))
barra.icone:SetTexCoord(_unpack(texCoords))
barra.minha_tabela = self
barra.nome_inimigo = tabela [1]
@@ -1888,7 +1888,7 @@ function atributo_heal:MontaInfoHealingDone()
for spellid, tabela in pairs(tabela) do
local nome, rank, icone = _GetSpellInfo(spellid)
tinsert (minhas_curas, {
tinsert(minhas_curas, {
spellid,
tabela.total,
tabela.total/total*100,
@@ -1911,11 +1911,11 @@ function atributo_heal:MontaInfoHealingDone()
local PetSkillsContainer = PetActor.spells._ActorTable
for _spellid, _skill in pairs(PetSkillsContainer) do --da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo(_spellid)
tinsert (minhas_curas, {
tinsert(minhas_curas, {
_spellid,
_skill.total,
_skill.total/total*100,
nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)",
nome .. " (|c" .. class_color .. PetName:gsub((" <.*"), "") .. "|r)",
icone,
PetActor
})
@@ -1937,7 +1937,7 @@ function atributo_heal:MontaInfoHealingDone()
if (not barra) then
barra = gump:CriaNovaBarraInfo1 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
barra.on_focus = false
end
@@ -1947,13 +1947,13 @@ function atributo_heal:MontaInfoHealingDone()
if (info.sub_atributo == 2) then
local formated_value = SelectedToKFunction (_, _math_floor(tabela[2]/meu_tempo))
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], formated_value, max_, tabela[3], tabela[5], true)
self:UpdadeInfoBar(barra, index, tabela[1], tabela[4], tabela[2], formated_value, max_, tabela[3], tabela[5], true)
else
local formated_value = SelectedToKFunction (_, _math_floor(tabela[2]))
if (tabela [7]) then
formated_value = formated_value .. " [|cFFFF5500" .. SelectedToKFunction (_, _math_floor(tabela [7])) .." " .. Loc ["STRING_DAMAGE"] .."|r] "
end
self:UpdadeInfoBar (barra, index, tabela[1], tabela[4], tabela[2], formated_value, max_, tabela[3], tabela[5], true)
self:UpdadeInfoBar(barra, index, tabela[1], tabela[4], tabela[2], formated_value, max_, tabela[3], tabela[5], true)
end
barra.minha_tabela = self
@@ -1971,7 +1971,7 @@ function atributo_heal:MontaInfoHealingDone()
local healedTargets = {}
tabela = self.targets
for target_name, amount in pairs(tabela) do
tinsert (healedTargets, {target_name, amount, amount / total*100})
tinsert(healedTargets, {target_name, amount, amount / total*100})
end
_table_sort(healedTargets, _detalhes.Sort2)
@@ -1984,7 +1984,7 @@ function atributo_heal:MontaInfoHealingDone()
if (not barra) then
barra = gump:CriaNovaBarraInfo2 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
end
local healingDone = tabela[2]
@@ -2001,7 +2001,7 @@ function atributo_heal:MontaInfoHealingDone()
else
barra.icone:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]]) --CLASSE
local texCoords = _detalhes.class_coords ["ENEMY"]
barra.icone:SetTexCoord (_unpack(texCoords))
barra.icone:SetTexCoord(_unpack(texCoords))
end
barra.lineText1:SetText(index .. ". " .. _detalhes:GetOnlyName(tabela[1]))
@@ -2161,7 +2161,7 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra)
for spellid, tabela in pairs(conteudo) do --da foreach em cada spellid do container
if (tabela.targets [actor]) then
local spell_nome, _, icone = _GetSpellInfo(spellid)
tinsert (minhas_magias, {spellid, tabela.targets [actor], tabela.targets [actor] / total*100, spell_nome, icone})
tinsert(minhas_magias, {spellid, tabela.targets [actor], tabela.targets [actor] / total*100, spell_nome, icone})
end
end
@@ -2175,7 +2175,7 @@ function atributo_heal:MontaDetalhesHealingTaken (nome, barra)
if (not barra) then --se a barra no existir, criar ela ento
barra = gump:CriaNovaBarraInfo3 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
end
if (index == 1) then
@@ -2239,11 +2239,11 @@ function atributo_heal:MontaDetalhesHealingDone (spellid, barra)
local index = 1
local data = data_table
table.wipe (t1)
table.wipe (t2)
table.wipe (t3)
table.wipe (t4)
table.wipe (data)
table.wipe(t1)
table.wipe(t2)
table.wipe(t3)
table.wipe(t4)
table.wipe(data)
if (esta_magia.total > 0) then
+18 -18
View File
@@ -1302,7 +1302,7 @@ end
--copy values from a previous skin saved
if (skin_table) then
--copy from skin_table to new_instance
_detalhes.table.copy (new_instance, skin_table)
_detalhes.table.copy(new_instance, skin_table)
end
return new_instance
@@ -1362,7 +1362,7 @@ end
--copy values from a previous skin saved
if (skin_table) then
--copy from skin_table to new_instance
_detalhes.table.copy (new_instance, skin_table)
_detalhes.table.copy(new_instance, skin_table)
end
--setup default wallpaper
@@ -2427,19 +2427,19 @@ function _detalhes:TrocaTabela(instancia, segmento, atributo, sub_atributo, inic
local atributo = instancia.atributo
local time_left = (_detalhes.last_data_requested+7) - _detalhes._tempo
if (atributo == 1 and _detalhes.in_combat and not _detalhes:CaptureGet ("damage") and _detalhes.host_by) then
if (atributo == 1 and _detalhes.in_combat and not _detalhes:CaptureGet("damage") and _detalhes.host_by) then
if (_detalhes.debug) then
_detalhes:Msg("(debug) instancia need damage cloud.")
end
elseif (atributo == 2 and _detalhes.in_combat and (not _detalhes:CaptureGet ("heal") or _detalhes:CaptureGet ("aura")) and _detalhes.host_by) then
elseif (atributo == 2 and _detalhes.in_combat and (not _detalhes:CaptureGet("heal") or _detalhes:CaptureGet("aura")) and _detalhes.host_by) then
if (_detalhes.debug) then
_detalhes:Msg("(debug) instancia need heal cloud.")
end
elseif (atributo == 3 and _detalhes.in_combat and not _detalhes:CaptureGet ("energy") and _detalhes.host_by) then
elseif (atributo == 3 and _detalhes.in_combat and not _detalhes:CaptureGet("energy") and _detalhes.host_by) then
if (_detalhes.debug) then
_detalhes:Msg("(debug) instancia need energy cloud.")
end
elseif (atributo == 4 and _detalhes.in_combat and not _detalhes:CaptureGet ("miscdata") and _detalhes.host_by) then
elseif (atributo == 4 and _detalhes.in_combat and not _detalhes:CaptureGet("miscdata") and _detalhes.host_by) then
if (_detalhes.debug) then
_detalhes:Msg("(debug) instancia need misc cloud.")
end
@@ -2750,7 +2750,7 @@ function _detalhes:ChangeIcon(icon)
if (icon) then
--plugin chamou uma troca de icone
self.baseframe.cabecalho.atributo_icon:SetTexture(icon)
self.baseframe.cabecalho.atributo_icon:SetTexCoord (5/64, 60/64, 3/64, 62/64)
self.baseframe.cabecalho.atributo_icon:SetTexCoord(5/64, 60/64, 3/64, 62/64)
local icon_size = skin.icon_plugins_size
self.baseframe.cabecalho.atributo_icon:SetWidth(icon_size[1])
@@ -2770,7 +2770,7 @@ function _detalhes:ChangeIcon(icon)
if (_detalhes.custom [self.sub_atributo]) then
local icon = _detalhes.custom [self.sub_atributo].icon
self.baseframe.cabecalho.atributo_icon:SetTexture(icon)
self.baseframe.cabecalho.atributo_icon:SetTexCoord (5/64, 60/64, 3/64, 62/64)
self.baseframe.cabecalho.atributo_icon:SetTexCoord(5/64, 60/64, 3/64, 62/64)
local icon_size = skin.icon_plugins_size
self.baseframe.cabecalho.atributo_icon:SetWidth(icon_size[1])
@@ -2791,7 +2791,7 @@ function _detalhes:ChangeIcon(icon)
end
local p = 0.125 --32/256
self.baseframe.cabecalho.atributo_icon:SetTexCoord (p * (self.sub_atributo-1), p * (self.sub_atributo), 0, 1)
self.baseframe.cabecalho.atributo_icon:SetTexCoord(p * (self.sub_atributo-1), p * (self.sub_atributo), 0, 1)
self.baseframe.cabecalho.atributo_icon:SetSize(16, 16)
self.baseframe.cabecalho.atributo_icon:ClearAllPoints()
@@ -2967,7 +2967,7 @@ local function GetDpsHps (_thisActor, key)
if (_thisActor [keyname]) then
return _thisActor [keyname]
else
if ((_detalhes.time_type == 2 and _thisActor.grupo) or not _detalhes:CaptureGet ("damage")) then
if ((_detalhes.time_type == 2 and _thisActor.grupo) or not _detalhes:CaptureGet("damage")) then
local dps = _thisActor.total / _thisActor:GetCombatTime()
_thisActor [keyname] = dps
return dps
@@ -3051,8 +3051,8 @@ end
local report_name_function = function(name)
local name, index = unpack(name)
if (_detalhes.remove_realm_from_name and name:find ("-")) then
return index .. ". " .. name:gsub (("%-.*"), "")
if (_detalhes.remove_realm_from_name and name:find("-")) then
return index .. ". " .. name:gsub(("%-.*"), "")
else
return index .. ". " .. name
end
@@ -3161,7 +3161,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
local reportarFrags = {}
for name, amount in pairs(frags) do
--string para imprimir direto sem calculos
reportarFrags [#reportarFrags+1] = {frag = tostring (amount), nome = name}
reportarFrags [#reportarFrags+1] = {frag = tostring(amount), nome = name}
end
container = reportarFrags
container_amount = #reportarFrags
@@ -3204,7 +3204,7 @@ function _detalhes:monta_relatorio (este_relatorio, custom)
local mortes = self.showing.last_events_tables
local reportarMortes = {}
for index, morte in ipairs(mortes) do
reportarMortes [#reportarMortes+1] = {dead = morte [6], nome = morte [3]:gsub (("%-.*"), "")}
reportarMortes [#reportarMortes+1] = {dead = morte [6], nome = morte [3]:gsub(("%-.*"), "")}
end
container = reportarMortes
container_amount = #reportarMortes
@@ -3515,8 +3515,8 @@ function _detalhes:envia_relatorio (linhas, custom)
local to_who = _detalhes.report_where
local channel = to_who:find ("CHANNEL")
local is_btag = to_who:find ("REALID")
local channel = to_who:find("CHANNEL")
local is_btag = to_who:find("REALID")
local send_report_channel = function(timerObject)
_SendChatMessage (timerObject.Arg1, timerObject.Arg2, timerObject.Arg3, timerObject.Arg4)
@@ -3530,7 +3530,7 @@ function _detalhes:envia_relatorio (linhas, custom)
if (channel) then
channel = to_who:gsub ((".*|"), "")
channel = to_who:gsub((".*|"), "")
for i = 1, #linhas do
if (channel == "Trade") then
@@ -3548,7 +3548,7 @@ function _detalhes:envia_relatorio (linhas, custom)
return
elseif (is_btag) then
local bnetAccountID = to_who:gsub ((".*|"), "")
local bnetAccountID = to_who:gsub((".*|"), "")
bnetAccountID = tonumber(bnetAccountID)
for i = 1, #linhas do
+16 -16
View File
@@ -265,7 +265,7 @@ function atributo_energy:AtualizarResources (whichRowLine, colocacao, instancia)
--texture color
actor_class_color_r, actor_class_color_g, actor_class_color_b = self:GetBarColor()
self:SetBarColors (esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b)
self:SetBarColors(esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b)
--icon
self:SetClassIcon (esta_barra.icone_classe, instancia, self.classe)
@@ -536,7 +536,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex
row1.textura:SetVertexColor(r, g, b)
row1.icone_classe:SetTexture(instancia.total_bar.icon)
row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375)
row1.icone_classe:SetTexCoord(0.0625, 0.9375, 0.0625, 0.9375)
Details.FadeHandler.Fader(row1, "out")
@@ -597,7 +597,7 @@ function atributo_energy:RefreshWindow (instancia, tabela_do_combate, forcar, ex
row1.textura:SetVertexColor(r, g, b)
row1.icone_classe:SetTexture(instancia.total_bar.icon)
row1.icone_classe:SetTexCoord (0.0625, 0.9375, 0.0625, 0.9375)
row1.icone_classe:SetTexCoord(0.0625, 0.9375, 0.0625, 0.9375)
Details.FadeHandler.Fader(row1, "out")
@@ -719,7 +719,7 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior,
Details.FadeHandler.Fader(esta_barra, "out")
end
return self:RefreshBarra (esta_barra, instancia)
return self:RefreshBarra(esta_barra, instancia)
else
return
end
@@ -743,7 +743,7 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior,
esta_barra.background:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b)
end
return self:RefreshBarra (esta_barra, instancia)
return self:RefreshBarra(esta_barra, instancia)
else
--agora esta comparando se a tabela da barra diferente da tabela na atualizao anterior
@@ -758,7 +758,7 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior,
esta_barra.last_value = esta_porcentagem --reseta o ultimo valor da barra
return self:RefreshBarra (esta_barra, instancia)
return self:RefreshBarra(esta_barra, instancia)
elseif (esta_porcentagem ~= esta_barra.last_value) then --continua mostrando a mesma tabela ento compara a porcentagem
--apenas atualizar
@@ -769,7 +769,7 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior,
end
esta_barra.last_value = esta_porcentagem
return self:RefreshBarra (esta_barra, instancia)
return self:RefreshBarra(esta_barra, instancia)
end
end
@@ -777,7 +777,7 @@ function atributo_energy:RefreshBarra2 (esta_barra, instancia, tabela_anterior,
end
function atributo_energy:RefreshBarra (esta_barra, instancia, from_resize)
function atributo_energy:RefreshBarra(esta_barra, instancia, from_resize)
local class, enemy, arena_enemy, arena_ally = self.classe, self.enemy, self.arena_enemy, self.arena_ally
@@ -788,7 +788,7 @@ function atributo_energy:RefreshBarra (esta_barra, instancia, from_resize)
--icon
self:SetClassIcon (esta_barra.icone_classe, instancia, class)
--texture color
self:SetBarColors (esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b)
self:SetBarColors(esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b)
--left text
self:SetBarLeftText (esta_barra, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText)
@@ -1116,16 +1116,16 @@ function atributo_energy:MontaInfoRegenRecebido()
if (not barra) then
barra = gump:CriaNovaBarraInfo1 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
barra.on_focus = false
end
self:FocusLock (barra, tabela[1])
self:FocusLock(barra, tabela[1])
local spellname, _, spellicon = _GetSpellInfo(tabela [1])
local percent = tabela [2] / total_regenerado * 100
self:UpdadeInfoBar (barra, index, tabela[1], spellname, tabela[2], _detalhes:comma_value (tabela[2]), max_, percent, spellicon, true)
self:UpdadeInfoBar(barra, index, tabela[1], spellname, tabela[2], _detalhes:comma_value (tabela[2]), max_, percent, spellicon, true)
barra.minha_tabela = self
barra.show = tabela[1]
@@ -1178,7 +1178,7 @@ function atributo_energy:MontaInfoRegenRecebido()
if (not barra) then
barra = gump:CriaNovaBarraInfo2 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
end
if (index == 1) then
@@ -1274,7 +1274,7 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra)
if (not barra) then --se a barra no existir, criar ela ento
barra = gump:CriaNovaBarraInfo3 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
end
if (index == 1) then
@@ -1286,10 +1286,10 @@ function atributo_energy:MontaDetalhesRegenRecebido (nome, barra)
barra.lineText1:SetText(index .. "." .. tabela [1])
barra.lineText4:SetText(_detalhes:comma_value (tabela[2]) .." (" .. _cstr("%.1f", tabela[2] / total_regenerado * 100) .."%)")
barra.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [tabela[3]]))
barra.textura:SetStatusBarColor(_unpack(_detalhes.class_colors [tabela[3]]))
barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small")
barra.icone:SetTexCoord (_unpack(_detalhes.class_coords [tabela[3]]))
barra.icone:SetTexCoord(_unpack(_detalhes.class_coords [tabela[3]]))
barra:Show() --mostra a barra
+29 -29
View File
@@ -591,12 +591,12 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta
morte.minha_barra = whichRowLine
esta_barra.colocacao = colocacao
if (not getmetatable (morte)) then
if (not getmetatable(morte)) then
setmetatable(morte, {__call = RefreshBarraMorte})
morte._custom = true
end
esta_barra.lineText1:SetText(colocacao .. ". " .. morte [3]:gsub (("%-.*"), ""))
esta_barra.lineText1:SetText(colocacao .. ". " .. morte [3]:gsub(("%-.*"), ""))
esta_barra.lineText2:SetText("")
esta_barra.lineText3:SetText("")
esta_barra.lineText4:SetText(morte [6])
@@ -608,18 +608,18 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta
--seta a cor da barra e a cor do texto caso eles esteja mostrando com a cor da classe
local r, g, b, a = unpack(_detalhes.class_colors [morte[4]])
_detalhes:SetBarColors (esta_barra, instancia, r, g, b, a)
_detalhes:SetBarColors(esta_barra, instancia, r, g, b, a)
if (instancia.row_info.use_spec_icons) then
local nome = morte[3]
local spec = instancia.showing (1, nome) and instancia.showing (1, nome).spec or (instancia.showing (2, nome) and instancia.showing (2, nome).spec)
if (spec and spec ~= 0) then
esta_barra.icone_classe:SetTexture(instancia.row_info.spec_file)
esta_barra.icone_classe:SetTexCoord (unpack(_detalhes.class_specs_coords[spec]))
esta_barra.icone_classe:SetTexCoord(unpack(_detalhes.class_specs_coords[spec]))
else
if (CLASS_ICON_TCOORDS [morte[4]]) then
esta_barra.icone_classe:SetTexture(instancia.row_info.icon_file)
esta_barra.icone_classe:SetTexCoord (unpack(CLASS_ICON_TCOORDS [morte[4]]))
esta_barra.icone_classe:SetTexCoord(unpack(CLASS_ICON_TCOORDS [morte[4]]))
else
local texture, l, r, t, b = Details:GetUnknownClassIcon()
esta_barra.icone_classe:SetTexture(texture)
@@ -629,7 +629,7 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta
else
if (CLASS_ICON_TCOORDS [morte[4]]) then
esta_barra.icone_classe:SetTexture(instancia.row_info.icon_file)
esta_barra.icone_classe:SetTexCoord (unpack(CLASS_ICON_TCOORDS [morte[4]]))
esta_barra.icone_classe:SetTexCoord(unpack(CLASS_ICON_TCOORDS [morte[4]]))
else
local texture, l, r, t, b = Details:GetUnknownClassIcon()
esta_barra.icone_classe:SetTexture(texture)
@@ -957,7 +957,7 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo
Details.FadeHandler.Fader(esta_barra, "out")
end
return self:RefreshBarra (esta_barra, instancia)
return self:RefreshBarra(esta_barra, instancia)
else
return
end
@@ -981,7 +981,7 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo
esta_barra.background:SetVertexColor(actor_class_color_r, actor_class_color_g, actor_class_color_b)
end
return self:RefreshBarra (esta_barra, instancia)
return self:RefreshBarra(esta_barra, instancia)
else
--agora esta comparando se a tabela da barra diferente da tabela na atualizao anterior
@@ -996,7 +996,7 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo
esta_barra.last_value = esta_porcentagem --reseta o ultimo valor da barra
return self:RefreshBarra (esta_barra, instancia)
return self:RefreshBarra(esta_barra, instancia)
elseif (esta_porcentagem ~= esta_barra.last_value) then --continua mostrando a mesma tabela ento compara a porcentagem
--apenas atualizar
@@ -1007,7 +1007,7 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo
end
esta_barra.last_value = esta_porcentagem
return self:RefreshBarra (esta_barra, instancia)
return self:RefreshBarra(esta_barra, instancia)
end
end
@@ -1015,7 +1015,7 @@ function atributo_misc:RefreshBarra2 (esta_barra, instancia, tabela_anterior, fo
end
function atributo_misc:RefreshBarra (esta_barra, instancia, from_resize)
function atributo_misc:RefreshBarra(esta_barra, instancia, from_resize)
local class, enemy, arena_enemy, arena_ally = self.classe, self.enemy, self.arena_enemy, self.arena_ally
if (from_resize) then
@@ -1025,7 +1025,7 @@ function atributo_misc:RefreshBarra (esta_barra, instancia, from_resize)
--icon
self:SetClassIcon (esta_barra.icone_classe, instancia, class)
--texture color
self:SetBarColors (esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b)
self:SetBarColors(esta_barra, instancia, actor_class_color_r, actor_class_color_g, actor_class_color_b)
--left text
self:SetBarLeftText (esta_barra, instancia, enemy, arena_enemy, arena_ally, UsingCustomLeftText)
@@ -1115,7 +1115,7 @@ function atributo_misc:ToolTipCC (instancia, numero, barra)
for target_name, amount in pairs(_tabela.targets) do
GameCooltip:AddLine(target_name .. ": ", amount .. " ")
local classe = _detalhes:GetClass (target_name)
local classe = _detalhes:GetClass(target_name)
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\espadas]], nil, 1, lineHeight, lineHeight)
if (classe) then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], nil, 2, lineHeight, lineHeight, unpack(_detalhes.class_coords [classe]))
@@ -1269,7 +1269,7 @@ function atributo_misc:ToolTipDispell (instancia, numero, barra)
_detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha)
end
local n = _table [1]:gsub (("%s%<.*"), "")
local n = _table [1]:gsub(("%s%<.*"), "")
GameCooltip:AddLine(n, _table [2] .. " (" .. _math_floor(_table [2]/self.dispell*100) .. "%)")
_detalhes:AddTooltipBackgroundStatusbar()
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1)
@@ -1462,7 +1462,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
for buffIndex = 1, 41 do
local name, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura (RaidIndex, buffIndex, nil, "HELPFUL")
if (name and unitCaster and UnitExists (unitCaster) and UnitExists (RaidIndex) and UnitIsUnit (unitCaster, RaidIndex)) then
if (name and unitCaster and UnitExists(unitCaster) and UnitExists(RaidIndex) and UnitIsUnit(unitCaster, RaidIndex)) then
_detalhes.parser:add_buff_uptime (nil, cacheGetTime, playerGUID, playerName, 0x00000514, playerGUID, playerName, 0x00000514, 0x0, spellid, name, in_or_out)
if (in_or_out == "BUFF_UPTIME_IN") then
@@ -1483,7 +1483,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
for playername, potspellid in pairs(pot_usage) do
local name, _, icon = _GetSpellInfo(potspellid)
local _, class = UnitClass (playername)
local _, class = UnitClass(playername)
local class_color = ""
if (class and RAID_CLASS_COLORS [class]) then
class_color = RAID_CLASS_COLORS [class].colorStr
@@ -1505,7 +1505,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
for groupIndex = 1, GetNumGroupMembers() - 1 do
for buffIndex = 1, 41 do
local name, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("party"..groupIndex, buffIndex, nil, "HELPFUL")
if (name and unitCaster and UnitExists (unitCaster) and UnitExists ("party" .. groupIndex) and UnitIsUnit (unitCaster, "party" .. groupIndex)) then
if (name and unitCaster and UnitExists(unitCaster) and UnitExists("party" .. groupIndex) and UnitIsUnit(unitCaster, "party" .. groupIndex)) then
local playerName, realmName = _UnitName ("party"..groupIndex)
local playerGUID = UnitGUID("party"..groupIndex)
@@ -1533,7 +1533,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
--player it self
for buffIndex = 1, 41 do
local name, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL")
if (name and unitCaster and UnitExists (unitCaster) and UnitIsUnit (unitCaster, "player")) then
if (name and unitCaster and UnitExists(unitCaster) and UnitIsUnit(unitCaster, "player")) then
local playerName = _UnitName ("player")
local playerGUID = UnitGUID("player")
if (playerGUID) then
@@ -1555,7 +1555,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
for playername, potspellid in pairs(pot_usage) do
local name, _, icon = _GetSpellInfo(potspellid)
local _, class = UnitClass (playername)
local _, class = UnitClass(playername)
local class_color = ""
if (class and RAID_CLASS_COLORS [class]) then
class_color = RAID_CLASS_COLORS [class].colorStr
@@ -1574,7 +1574,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
for buffIndex = 1, 41 do
local name, _, _, _, _, _, unitCaster, _, _, spellid = _UnitAura ("player", buffIndex, nil, "HELPFUL")
if (name and unitCaster and UnitExists (unitCaster) and UnitIsUnit (unitCaster, "player")) then
if (name and unitCaster and UnitExists(unitCaster) and UnitIsUnit(unitCaster, "player")) then
local playerName = _UnitName ("player")
local playerGUID = UnitGUID("player")
@@ -1596,7 +1596,7 @@ function _detalhes:CatchRaidBuffUptime (in_or_out)
local string_output = "pre-potion: "
for playername, potspellid in pairs(pot_usage) do
local name, _, icon = _GetSpellInfo(potspellid)
local _, class = UnitClass (playername)
local _, class = UnitClass(playername)
local class_color = ""
if (class and RAID_CLASS_COLORS [class]) then
class_color = RAID_CLASS_COLORS [class].colorStr
@@ -1999,7 +1999,7 @@ function atributo_misc:ToolTipInterrupt (instancia, numero, barra)
_detalhes:AddTooltipHeaderStatusbar (r, g, b, barAlha)
end
local n = _table [1]:gsub (("%s%<.*"), "")
local n = _table [1]:gsub(("%s%<.*"), "")
GameCooltip:AddLine(n, _table [2] .. " (" .. _math_floor(_table [2]/self.interrupt*100) .. "%)")
_detalhes:AddTooltipBackgroundStatusbar()
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 14, 14, 0.25, 0.49609375, 0.75, 1)
@@ -2048,7 +2048,7 @@ function atributo_misc:MontaInfoInterrupt()
--player
for _spellid, _tabela in pairs(minha_tabela) do --da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo(_spellid)
tinsert (meus_interrupts, {_spellid, _tabela.counter, _tabela.counter/meu_total*100, nome, icone})
tinsert(meus_interrupts, {_spellid, _tabela.counter, _tabela.counter/meu_total*100, nome, icone})
end
--pet
local ActorPets = self.pets
@@ -2059,7 +2059,7 @@ function atributo_misc:MontaInfoInterrupt()
local PetSkillsContainer = PetActor.interrupt_spells._ActorTable
for _spellid, _skill in pairs(PetSkillsContainer) do --da foreach em cada spellid do container
local nome, _, icone = _GetSpellInfo(_spellid)
tinsert (meus_interrupts, {_spellid, _skill.counter, _skill.counter/meu_total*100, nome .. " (|c" .. class_color .. PetName:gsub ((" <.*"), "") .. "|r)", icone, PetActor})
tinsert(meus_interrupts, {_spellid, _skill.counter, _skill.counter/meu_total*100, nome .. " (|c" .. class_color .. PetName:gsub((" <.*"), "") .. "|r)", icone, PetActor})
end
end
end
@@ -2079,7 +2079,7 @@ function atributo_misc:MontaInfoInterrupt()
if (not barra) then --se a barra no existir, criar ela ento
barra = gump:CriaNovaBarraInfo1 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
barra.on_focus = false --isso aqui a parte da seleo e desceleo
end
@@ -2088,7 +2088,7 @@ function atributo_misc:MontaInfoInterrupt()
if (not info.mostrando_mouse_over) then
if (tabela[1] == self.detalhes) then --tabela [1] = spellid = spellid que esta na caixa da direita
if (not barra.on_focus) then --se a barra no tiver no foco
barra.textura:SetStatusBarColor (129/255, 125/255, 69/255, 1)
barra.textura:SetStatusBarColor(129/255, 125/255, 69/255, 1)
barra.on_focus = true
if (not info.mostrando) then
info.mostrando = barra
@@ -2096,7 +2096,7 @@ function atributo_misc:MontaInfoInterrupt()
end
else
if (barra.on_focus) then
barra.textura:SetStatusBarColor (1, 1, 1, 1) --volta a cor antiga
barra.textura:SetStatusBarColor(1, 1, 1, 1) --volta a cor antiga
barra:SetAlpha(.9) --volta a alfa antiga
barra.on_focus = false
end
@@ -2145,7 +2145,7 @@ function atributo_misc:MontaInfoInterrupt()
if (not barra) then
barra = gump:CriaNovaBarraInfo2 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1)
barra.textura:SetStatusBarColor(1, 1, 1, 1)
end
if (index == 1) then
@@ -2218,7 +2218,7 @@ function atributo_misc:MontaDetalhesInterrupt (spellid, barra)
if (not barra) then --se a barra no existir, criar ela ento
barra = gump:CriaNovaBarraInfo3 (instancia, index)
barra.textura:SetStatusBarColor (1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
barra.textura:SetStatusBarColor(1, 1, 1, 1) --isso aqui a parte da seleo e desceleo
end
if (index == 1) then
+12 -12
View File
@@ -382,7 +382,7 @@
actorObject.ownerName = dono_do_pet.nome
if (_IsInInstance() and _detalhes.remove_realm_from_name) then
actorObject.displayName = nome:gsub (("%-.*"), ">")
actorObject.displayName = nome:gsub(("%-.*"), ">")
else
actorObject.displayName = nome
end
@@ -485,7 +485,7 @@
--for _, playerName in ipairs(Details.tabela_vigente.raid_roster_indexed) do
for playerName, _ in pairs(_detalhes.tabela_vigente.raid_roster) do
local pName = playerName
playerName = playerName:gsub ("%-.*", "") --remove realm name
playerName = playerName:gsub("%-.*", "") --remove realm name
--if the user client is in russian language
--make an attempt to remove declensions from the character's name
@@ -495,12 +495,12 @@
return find_pet_found_owner (pName, serial, nome, flag, self)
else
--print("not found declension (1):", pName, nome)
if (text1:find (playerName)) then
if (text1:find(playerName)) then
return find_pet_found_owner (pName, serial, nome, flag, self)
end
end
else
if (text1:find (playerName)) then
if (text1:find(playerName)) then
return find_pet_found_owner (pName, serial, nome, flag, self)
end
end
@@ -513,19 +513,19 @@
for playerName, _ in pairs(_detalhes.tabela_vigente.raid_roster) do
--for _, playerName in ipairs(Details.tabela_vigente.raid_roster_indexed) do
local pName = playerName
playerName = playerName:gsub ("%-.*", "") --remove realm name
playerName = playerName:gsub("%-.*", "") --remove realm name
if (CONST_CLIENT_LANGUAGE == "ruRU") then
if (find_name_declension (text2, playerName)) then
return find_pet_found_owner (pName, serial, nome, flag, self)
else
--print("not found declension (2):", pName, nome)
if (text2:find (playerName)) then
if (text2:find(playerName)) then
return find_pet_found_owner (pName, serial, nome, flag, self)
end
end
else
if (text2:find (playerName)) then
if (text2:find(playerName)) then
return find_pet_found_owner (pName, serial, nome, flag, self)
end
end
@@ -542,7 +542,7 @@
--[[statistics]]-- _detalhes.statistics.container_calls = _detalhes.statistics.container_calls + 1
--if (flag and nome:find ("Kastfall") and bit.band(flag, 0x2000) ~= 0) then
--if (flag and nome:find("Kastfall") and bit.band(flag, 0x2000) ~= 0) then
--print("PET:", nome, _detalhes.tabela_pets.pets [serial], container_pets [serial])
--else
--print(nome, flag)
@@ -767,9 +767,9 @@
end
if (_detalhes.debug) then
if (_detalhes.debug_chr and nome:find (_detalhes.debug_chr) and self.tipo == 1) then
if (_detalhes.debug_chr and nome:find(_detalhes.debug_chr) and self.tipo == 1) then
local logLine = ""
local when = "[" .. date ("%H:%M:%S") .. format (".%4f", GetTime()-floor(GetTime())) .. "]"
local when = "[" .. date ("%H:%M:%S") .. format(".%4f", GetTime()-floor(GetTime())) .. "]"
local log = "actor created - class: " .. (novo_objeto.classe or "noclass")
local from = debugstack (2, 1, 0)
logLine = logLine .. when .. " " .. log .. " " .. from .. "\n"
@@ -809,7 +809,7 @@
_detalhes:UpdatePetsOnParser()
end
function _detalhes:ClearCCPetsBlackList()
table.wipe (pet_blacklist)
table.wipe(pet_blacklist)
end
function container_combatentes:FuncaoDeCriacao (tipo)
@@ -856,7 +856,7 @@
end
function container_combatentes:SortByKey (key)
assert (type(key) == "string", "Container:SortByKey() expects a keyname on parameter 1.")
assert(type(key) == "string", "Container:SortByKey() expects a keyname on parameter 1.")
bykey = key
_table_sort (self._ActorTable, sort)
self:remapear()
+3 -3
View File
@@ -45,7 +45,7 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags)
--in merging operations, make sure to not add the owner name a second time in the name
--check if the pet name already has the owner name in, if not, add it
if (not pet_nome:find ("<")) then
if (not pet_nome:find("<")) then
--get the owner name
local ownerName = busca[1]
--add the owner name to the pet name
@@ -104,7 +104,7 @@ function container_pets:PegaDono (pet_serial, pet_nome, pet_flags)
if (dono_nome) then
self.pets [pet_serial] = {dono_nome, dono_serial, dono_flags, _detalhes._tempo, true, pet_nome, pet_serial} --adicionada a flag emulada
if (not pet_nome:find ("<")) then
if (not pet_nome:find("<")) then
pet_nome = pet_nome .. " <".. dono_nome ..">"
end
@@ -209,7 +209,7 @@ end
function container_pets:Remover (pet_serial)
if (_detalhes.tabela_pets.pets [pet_serial]) then
table.wipe (_detalhes.tabela_pets.pets [pet_serial])
table.wipe(_detalhes.tabela_pets.pets [pet_serial])
end
_detalhes.tabela_pets.pets [pet_serial] = nil
end
+1 -1
View File
@@ -519,7 +519,7 @@ function segmentClass:resetar()
local cleargarbage = function()
collectgarbage()
end
local successful, errortext = pcall (cleargarbage)
local successful, errortext = pcall(cleargarbage)
if (not successful) then
Details:Msg("couldn't call collectgarbage()")
end
+9 -9
View File
@@ -59,7 +59,7 @@
for _, actor in ipairs(Details.tabela_vigente[class_type_dano]._ActorTable) do
if (not actor.grupo and not actor.owner and not actor.nome:find ("[*]") and bitBand(actor.flag_original, 0x00000060) ~= 0) then --0x20+0x40 neutral + enemy reaction
if (not actor.grupo and not actor.owner and not actor.nome:find("[*]") and bitBand(actor.flag_original, 0x00000060) ~= 0) then --0x20+0x40 neutral + enemy reaction
for name, _ in pairs(actor.targets) do
if (name == Details.playername) then
return actor.nome
@@ -218,7 +218,7 @@
end
for index = 1, 5, 1 do
if (UnitExists ("boss"..index)) then
if (UnitExists("boss"..index)) then
local guid = UnitGUID("boss"..index)
if (guid) then
local serial = Details:GetNpcIdFromGuid (guid)
@@ -645,7 +645,7 @@
--add to storage
if (not InCombatLockdown() and not UnitAffectingCombat("player") and not Details.logoff_saving_data) then
local successful, errortext = pcall (Details.Database.StoreEncounter)
local successful, errortext = pcall(Details.Database.StoreEncounter)
if (not successful) then
Details:Msg("error occurred on Details.Database.StoreEncounter():", errortext)
end
@@ -661,7 +661,7 @@
--add to storage
if (not InCombatLockdown() and not UnitAffectingCombat("player") and not Details.logoff_saving_data) then
local successful, errortext = pcall (Details.Database.StoreWipe)
local successful, errortext = pcall(Details.Database.StoreWipe)
if (not successful) then
Details:Msg("error occurred on Details.Database.StoreWipe():", errortext)
end
@@ -704,7 +704,7 @@
if (bossFunction) then
if (bitBand(bossFunctionType, 0x2) ~= 0) then --end of combat
if (not Details.logoff_saving_data) then
local successful, errortext = pcall (bossFunction, Details.tabela_vigente)
local successful, errortext = pcall(bossFunction, Details.tabela_vigente)
if (not successful) then
Details:Msg("error occurred on Encounter Boss Function:", errortext)
end
@@ -1095,11 +1095,11 @@
if (not IsInRaid() and not IsInGroup()) then
return
end
local _, playerClass = UnitClass ("player")
local _, playerClass = UnitClass("player")
local specIndex = DetailsFramework.GetSpecialization()
local playerSpecID
if (specIndex) then
playerSpecID = DetailsFramework.GetSpecializationInfo (specIndex)
playerSpecID = DetailsFramework.GetSpecializationInfo(specIndex)
end
if (playerSpecID and playerClass) then
@@ -1527,7 +1527,7 @@
end
function Details:SetTrashSuppression (n)
assert (type(n) == "number", "SetTrashSuppression expects a number on index 1.")
assert(type(n) == "number", "SetTrashSuppression expects a number on index 1.")
if (n < 0) then
n = 0
end
@@ -1703,7 +1703,7 @@
GameCooltip:SetBannerText (1, (not Details.ignore_nicktag and avatar [1]) or objeto.nome, textPoint, avatarTextColor, 14, SharedMedia:Fetch ("font", Details.tooltip.fontface)) --text [1] nickname
end
else
--if (Details.remove_realm_from_name and objeto.displayName:find ("%*")) then
--if (Details.remove_realm_from_name and objeto.displayName:find("%*")) then
-- GameCooltip:SetBannerImage (1, [[Interface\AddOns\Details\images\background]], 20, 30, avatarPoint, avatarTexCoord, {0, 0, 0, 0}) --overlay [2] avatar path
-- GameCooltip:SetBannerImage (2, [[Interface\PetBattles\Weather-BurntEarth]], 160, 30, {{"bottomleft", "topleft", 0, -5}, {"bottomright", "topright", 0, -5}}, {0.12, 0.88, 1, 0}, {0, 0, 0, 0.1}) --overlay [2] avatar path {0, 0, 0, 0}
-- GameCooltip:SetBannerText (1, objeto.nome, {"left", "left", 11, -8}, {1, 1, 1, 0.7}, 10, SharedMedia:Fetch ("font", Details.tooltip.fontface)) --text [1] nickname
+20 -20
View File
@@ -222,7 +222,7 @@ end
local statusbar_enabled1 = window1.show_statusbar
local statusbar_enabled2 = window2.show_statusbar
table.wipe (window1.snap); table.wipe (window2.snap)
table.wipe(window1.snap); table.wipe(window2.snap)
window1.snap [3] = 2; window2.snap [1] = 1;
window1.horizontalSnap = true; window2.horizontalSnap = true
@@ -425,12 +425,12 @@ function _detalhes:ResetSpecCache (forced)
local isininstance = IsInInstance()
if (forced or (not isininstance and not _detalhes.in_group)) then
table.wipe (_detalhes.cached_specs)
table.wipe(_detalhes.cached_specs)
if (_detalhes.track_specs) then
local my_spec = DetailsFramework.GetSpecialization()
if (type(my_spec) == "number") then
local spec_number = DetailsFramework.GetSpecializationInfo (my_spec)
local spec_number = DetailsFramework.GetSpecializationInfo(my_spec)
if (type(spec_number) == "number") then
local pguid = UnitGUID(_detalhes.playername)
if (pguid) then
@@ -441,7 +441,7 @@ function _detalhes:ResetSpecCache (forced)
end
elseif (_detalhes.in_group and not isininstance) then
table.wipe (_detalhes.cached_specs)
table.wipe(_detalhes.cached_specs)
if (_detalhes.track_specs) then
if (IsInRaid()) then
@@ -635,12 +635,12 @@ local task_timers = {
function _detalhes:RegisterBackgroundTask (name, func, priority, ...)
assert (type(self) == "table", "RegisterBackgroundTask 'self' must be a table.")
assert (type(name) == "string", "RegisterBackgroundTask param #1 must be a string.")
assert(type(self) == "table", "RegisterBackgroundTask 'self' must be a table.")
assert(type(name) == "string", "RegisterBackgroundTask param #1 must be a string.")
if (type(func) == "string") then
assert (type(self [func]) == "function", "RegisterBackgroundTask param #2 function not found on main object.")
assert(type(self [func]) == "function", "RegisterBackgroundTask param #2 function not found on main object.")
else
assert (type(func) == "function", "RegisterBackgroundTask param #2 expect a function or function name.")
assert(type(func) == "function", "RegisterBackgroundTask param #2 expect a function or function name.")
end
priority = priority or "LOW"
@@ -775,7 +775,7 @@ function _detalhes.storage:GetBestFromGuild (diff, encounter_id, role, dps, guil
if (not role) then
role = "damage"
end
role = string.lower (role)
role = string.lower(role)
if (role == "damager") then
role = "damage"
elseif (role == "healer") then
@@ -839,7 +839,7 @@ function _detalhes.storage:GetPlayerGuildRank (diff, encounter_id, role, playern
if (not role) then
role = "damage"
end
role = string.lower (role)
role = string.lower(role)
if (role == "damager") then
role = "damage"
elseif (role == "healer") then
@@ -920,7 +920,7 @@ function _detalhes.storage:GetBestFromPlayer (diff, encounter_id, role, playerna
if (not role) then
role = "damage"
end
role = string.lower (role)
role = string.lower(role)
if (role == "damager") then
role = "damage"
elseif (role == "healer") then
@@ -1266,7 +1266,7 @@ function _detalhes.storage:GetPlayerData (diff, encounter_id, playername)
end
local t = {}
assert (type(playername) == "string", "PlayerName must be a string.")
assert(type(playername) == "string", "PlayerName must be a string.")
if (not diff) then
@@ -1334,8 +1334,8 @@ function _detalhes.storage:GetEncounterData (diff, encounter_id, guild)
local data = db [diff]
assert (data, "Difficulty not found. Use: 14, 15 or 16.")
assert (type(encounter_id) == "number", "EncounterId must be a number.")
assert(data, "Difficulty not found. Use: 14, 15 or 16.")
assert(type(encounter_id) == "number", "EncounterId must be a number.")
data = data [encounter_id]
@@ -1723,7 +1723,7 @@ function Details.Database.StoreEncounter(combat)
player_name = player_name .. "-" .. player_realm
end
local _, _, class = UnitClass (player_name)
local _, _, class = UnitClass(player_name)
local damage_actor = damage_container_pool [damage_container_hash [player_name]]
if (damage_actor) then
@@ -1736,7 +1736,7 @@ function Details.Database.StoreEncounter(combat)
player_name = player_name .. "-" .. player_realm
end
local _, _, class = UnitClass (player_name)
local _, _, class = UnitClass(player_name)
local heal_actor = healing_container_pool [healing_container_hash [player_name]]
if (heal_actor) then
@@ -1769,11 +1769,11 @@ function Details.Database.StoreEncounter(combat)
if (myBestDps > d_one) then
if (not _detalhes.deny_score_messages) then
print(Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_NOTBEST"], _detalhes:ToK2 (d_one), _detalhes:ToK2 (myBestDps), onencounter.date, mybest[2]))
print(Loc ["STRING_DETAILS1"] .. format(Loc ["STRING_SCORE_NOTBEST"], _detalhes:ToK2 (d_one), _detalhes:ToK2 (myBestDps), onencounter.date, mybest[2]))
end
else
if (not _detalhes.deny_score_messages) then
print(Loc ["STRING_DETAILS1"] .. format (Loc ["STRING_SCORE_BEST"], _detalhes:ToK2 (d_one)))
print(Loc ["STRING_DETAILS1"] .. format(Loc ["STRING_SCORE_BEST"], _detalhes:ToK2 (d_one)))
end
end
end
@@ -1978,7 +1978,7 @@ function ilvl_core:CalcItemLevel (unitid, guid, shout)
if (ilvl_core.forced_inspects [guid]) then
if (type(ilvl_core.forced_inspects [guid].callback) == "function") then
local okey, errortext = pcall (ilvl_core.forced_inspects[guid].callback, guid, unitid, ilvl_core.forced_inspects[guid].param1, ilvl_core.forced_inspects[guid].param2)
local okey, errortext = pcall(ilvl_core.forced_inspects[guid].callback, guid, unitid, ilvl_core.forced_inspects[guid].param1, ilvl_core.forced_inspects[guid].param2)
if (not okey) then
_detalhes:Msg("Error on QueryInspect callback: " .. errortext)
end
@@ -2069,7 +2069,7 @@ function ilvl_core:GetItemLevel (unitid, guid, is_forced, try_number)
end
local NotifyInspectHook = function(unitid)
local unit = unitid:gsub ("%d+", "")
local unit = unitid:gsub("%d+", "")
if ((IsInRaid() or IsInGroup()) and (_detalhes:GetZoneType() == "raid" or _detalhes:GetZoneType() == "party")) then
local guid = UnitGUID(unitid)
+4 -4
View File
@@ -77,9 +77,9 @@
local nome = esta_classe.nome
if (is_in_instance and _detalhes.remove_realm_from_name) then
esta_classe.displayName = nome:gsub (("%-.*"), "")
esta_classe.displayName = nome:gsub(("%-.*"), "")
elseif (_detalhes.remove_realm_from_name) then
esta_classe.displayName = nome:gsub (("%-.*"), "") --"%*"
esta_classe.displayName = nome:gsub(("%-.*"), "") --"%*"
else
esta_classe.displayName = nome
end
@@ -205,9 +205,9 @@
local nome = esta_classe.nome
if (is_in_instance and _detalhes.remove_realm_from_name) then
esta_classe.displayName = nome:gsub (("%-.*"), "")
esta_classe.displayName = nome:gsub(("%-.*"), "")
elseif (_detalhes.remove_realm_from_name) then
esta_classe.displayName = nome:gsub (("%-.*"), "") --%*
esta_classe.displayName = nome:gsub(("%-.*"), "") --%*
else
esta_classe.displayName = nome
end
+20 -20
View File
@@ -241,7 +241,7 @@
[66992] = 49921, --offhand
--Seal of Command
[20424] = 69403,
[20424] = 69403, --53739 and 53733
}
else --retail
@@ -577,7 +577,7 @@
local targetLine = ""
for i = 1, 5 do
local boss = UnitExists ("boss" .. i)
local boss = UnitExists("boss" .. i)
if (boss) then
local target = UnitName ("boss" .. i .. "target")
if (target and type(target) == "string") then
@@ -1002,7 +1002,7 @@
if (who_serial ~= "") then
damage_cache [who_serial] = este_jogador
else
if (who_name:find ("%[")) then
if (who_name:find("%[")) then
damage_cache [who_name] = este_jogador
local _, _, icon = _GetSpellInfo(spellid or 1)
este_jogador.spellicon = icon
@@ -1284,7 +1284,7 @@
else
if (
(bitBand(alvo_flags, REACTION_FRIENDLY) ~= 0 and bitBand(who_flags, REACTION_FRIENDLY) ~= 0) or --ajdt d' brx
(raid_members_cache [alvo_serial] and raid_members_cache [who_serial] and alvo_serial:find ("Player") and who_serial:find ("Player")) --amrl
(raid_members_cache [alvo_serial] and raid_members_cache [who_serial] and alvo_serial:find("Player") and who_serial:find("Player")) --amrl
) then
is_friendly_fire = true
end
@@ -1431,7 +1431,7 @@
if (who_serial ~= "") then
damage_cache [who_serial] = este_jogador
else
if (who_name:find ("%[")) then
if (who_name:find("%[")) then
damage_cache [who_name] = este_jogador
local _, _, icon = _GetSpellInfo(spellid or 1)
este_jogador.spellicon = icon
@@ -1636,7 +1636,7 @@
if (who_serial ~= "") then
damage_cache [who_serial] = este_jogador
else
if (who_name:find ("%[")) then
if (who_name:find("%[")) then
damage_cache [who_name] = este_jogador
local _, _, icon = _GetSpellInfo(spellid or 1)
este_jogador.spellicon = icon
@@ -4175,7 +4175,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
if (not jaTem) then
tinsert (_current_combat.last_events_tables [i] [1], 1, {
tinsert(_current_combat.last_events_tables [i] [1], 1, {
2,
spellid,
1,
@@ -4412,18 +4412,18 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (last_index < _death_event_amt+1 and not t[last_index][4]) then
for i = 1, last_index-1 do
if (t[i][4] and t[i][4]+_death_event_amt > time) then
tinsert (esta_morte, t[i])
tinsert(esta_morte, t[i])
end
end
else
for i = last_index, _death_event_amt do --next index to 16
if (t[i][4] and t[i][4]+_death_event_amt > time) then
tinsert (esta_morte, t[i])
tinsert(esta_morte, t[i])
end
end
for i = 1, last_index-1 do --1 to latest index
if (t[i][4] and t[i][4]+_death_event_amt > time) then
tinsert (esta_morte, t[i])
tinsert(esta_morte, t[i])
end
end
end
@@ -4470,7 +4470,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
local t = {esta_morte, time, thisPlayer.nome, thisPlayer.classe, maxHealth, minutos.."m "..segundos.."s", ["dead"] = true, ["last_cooldown"] = thisPlayer.last_cooldown, ["dead_at"] = decorrido}
tinsert (_current_combat.last_events_tables, #_current_combat.last_events_tables+1, t)
tinsert(_current_combat.last_events_tables, #_current_combat.last_events_tables+1, t)
if (_hook_deaths) then
--send event to registred functions
@@ -4583,7 +4583,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
end
end
function _detalhes:CaptureGet (capture_type)
function _detalhes:CaptureGet(capture_type)
return _detalhes.capture_real [capture_type]
end
@@ -4634,7 +4634,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
function _detalhes:CaptureDisable (capture_type)
capture_type = string.lower (capture_type)
capture_type = string.lower(capture_type)
if (capture_type == "damage") then
token_list ["SPELL_PERIODIC_DAMAGE"] = nil
@@ -4701,7 +4701,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
function _detalhes:CaptureEnable (capture_type)
capture_type = string.lower (capture_type)
capture_type = string.lower(capture_type)
--retail
if (capture_type == "damage") then
token_list ["SPELL_PERIODIC_DAMAGE"] = parser.spell_dmg
@@ -5235,7 +5235,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes:EntrarEmCombate()
end
if (not _detalhes:CaptureGet ("damage")) then
if (not _detalhes:CaptureGet("damage")) then
_detalhes:EntrarEmCombate()
end
@@ -5316,7 +5316,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
--store a boss encounter when out of combat since it might need to load the storage
if (_detalhes.schedule_store_boss_encounter) then
if (not _detalhes.logoff_saving_data) then
local successful, errortext = pcall (Details.Database.StoreEncounter)
local successful, errortext = pcall(Details.Database.StoreEncounter)
if (not successful) then
_detalhes:Msg("error occurred on Details.Database.StoreEncounter():", errortext)
end
@@ -5326,7 +5326,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (Details.schedule_store_boss_encounter_wipe) then
if (not _detalhes.logoff_saving_data) then
local successful, errortext = pcall (Details.Database.StoreWipe)
local successful, errortext = pcall(Details.Database.StoreWipe)
if (not successful) then
_detalhes:Msg("error occurred on Details.Database.StoreWipe():", errortext)
end
@@ -5523,7 +5523,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
local specIndex = DetailsFramework.GetSpecialization()
if (specIndex) then
local specID = DetailsFramework.GetSpecializationInfo (specIndex)
local specID = DetailsFramework.GetSpecializationInfo(specIndex)
if (specID and specID ~= 0) then
local guid = UnitGUID("player")
if (guid) then
@@ -5555,7 +5555,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (_detalhes.zone_type == "none" and unit) then
local serial = UnitGUID(unit)
--the serial is valid and isn't THE player and the serial is from a player?
if (serial and serial ~= UnitGUID("player") and serial:find ("Player")) then
if (serial and serial ~= UnitGUID("player") and serial:find("Player")) then
_detalhes.duel_candidates[serial] = GetTime()
local playerName = _detalhes:GetCLName(unit)
@@ -5885,7 +5885,7 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
_detalhes.can_panic_mode = true
end
if (_detalhes.CheckSwitchOnLogon and _detalhes.tabela_instancias[1] and _detalhes.tabela_instancias and getmetatable (_detalhes.tabela_instancias[1])) then
if (_detalhes.CheckSwitchOnLogon and _detalhes.tabela_instancias[1] and _detalhes.tabela_instancias and getmetatable(_detalhes.tabela_instancias[1])) then
tinsert(_detalhes_global.exit_log, "4 - Reversing switches.")
currentStep = "Check Switch on Logon"
xpcall (_detalhes.CheckSwitchOnLogon, saver_error)
+19 -19
View File
@@ -29,7 +29,7 @@
local instance = self:GetPluginInstance()
if (instance) then
self.row_info = self.row_info or {}
_detalhes.table.copy (self.row_info, instance.row_info)
_detalhes.table.copy(self.row_info, instance.row_info)
self.bars_grow_direction = instance.bars_grow_direction
self.row_height = instance.row_height
self:SetBarGrowDirection()
@@ -412,7 +412,7 @@
Details.gump:ApplyStandardBackdrop(options_frame)
Details.gump:CreateTitleBar (options_frame, title)
local bigdog = _detalhes.gump:NewImage (options_frame, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 110, 120, nil, {1, 0, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog")
local bigdog = _detalhes.gump:NewImage(options_frame, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 110, 120, nil, {1, 0, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog")
bigdog:SetPoint("bottomright", options_frame, "bottomright", -3, 0)
bigdog:SetAlpha(.25)
@@ -486,7 +486,7 @@
menuBackground:SetPoint("bottomright", f, "bottomleft", -2, 0)
menuBackground:SetWidth(f.MenuButtonWidth + 6)
local bigdog = _detalhes.gump:NewImage (menuBackground, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 180*0.7, 200*0.7, "overlay", {0, 1, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog")
local bigdog = _detalhes.gump:NewImage(menuBackground, [[Interface\MainMenuBar\UI-MainMenuBar-EndCap-Human]], 180*0.7, 200*0.7, "overlay", {0, 1, 0, 1}, "backgroundBigDog", "$parentBackgroundBigDog")
bigdog:SetPoint("bottomleft", custom_window, "bottomleft", 0, 1)
bigdog:SetAlpha(0.3)
@@ -497,22 +497,22 @@
bigdogRow:SetPoint("bottomleft", menuBackground, "bottomleft", 1, 1)
bigdogRow:SetPoint("bottomright", menuBackground, "bottomright", -1, 1)
bigdogRow:SetHeight(20)
bigdogRow:SetColorTexture (.5, .5, .5, .1)
bigdogRow:SetColorTexture(.5, .5, .5, .1)
bigdogRow:Hide()
--
--plugins menu title bar
local titlebar_plugins = CreateFrame("frame", nil, menuBackground,"BackdropTemplate")
PixelUtil.SetPoint (titlebar_plugins, "topleft", menuBackground, "topleft", 2, -3)
PixelUtil.SetPoint (titlebar_plugins, "topright", menuBackground, "topright", -2, -3)
PixelUtil.SetPoint(titlebar_plugins, "topleft", menuBackground, "topleft", 2, -3)
PixelUtil.SetPoint(titlebar_plugins, "topright", menuBackground, "topright", -2, -3)
titlebar_plugins:SetHeight(f.TitleHeight)
titlebar_plugins:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\AddOns\Details\images\background]], tileSize = 64, tile = true})
titlebar_plugins:SetBackdropColor(.5, .5, .5, 1)
titlebar_plugins:SetBackdropBorderColor(0, 0, 0, 1)
--title
local titleLabel = _detalhes.gump:NewLabel(titlebar_plugins, titlebar_plugins, nil, "titulo", "Plugins", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
PixelUtil.SetPoint (titleLabel, "center", titlebar_plugins , "center", 0, 0)
PixelUtil.SetPoint (titleLabel, "top", titlebar_plugins , "top", 0, -5)
PixelUtil.SetPoint(titleLabel, "center", titlebar_plugins , "center", 0, 0)
PixelUtil.SetPoint(titleLabel, "top", titlebar_plugins , "top", 0, -5)
--plugins menu title bar
local titlebar_tools = CreateFrame("frame", nil, menuBackground,"BackdropTemplate")
@@ -522,8 +522,8 @@
titlebar_tools:SetBackdropBorderColor(0, 0, 0, 1)
--title
local titleLabel = _detalhes.gump:NewLabel(titlebar_tools, titlebar_tools, nil, "titulo", "Tools", "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
PixelUtil.SetPoint (titleLabel, "center", titlebar_tools , "center", 0, 0)
PixelUtil.SetPoint (titleLabel, "top", titlebar_tools , "top", 0, -5)
PixelUtil.SetPoint(titleLabel, "center", titlebar_tools , "center", 0, 0)
PixelUtil.SetPoint(titleLabel, "top", titlebar_tools , "top", 0, -5)
--scripts
f:SetScript("OnShow", function()
@@ -648,7 +648,7 @@
--frame:SetScript("OnHide", on_hide)
frame:HookScript ("OnHide", on_hide)
frame:ClearAllPoints()
PixelUtil.SetPoint (frame, "topleft", f, "topleft", 0, 0)
PixelUtil.SetPoint(frame, "topleft", f, "topleft", 0, 0)
frame:Show()
end
@@ -695,13 +695,13 @@
if (not addingTools) then
--add the header
addingTools = true
PixelUtil.SetPoint (titlebar_tools, "topleft", menuBackground, "topleft", 2, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 20)
PixelUtil.SetPoint (titlebar_tools, "topright", menuBackground, "topright", -2, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 20)
PixelUtil.SetPoint(titlebar_tools, "topleft", menuBackground, "topleft", 2, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 20)
PixelUtil.SetPoint(titlebar_tools, "topright", menuBackground, "topright", -2, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 20)
end
PixelUtil.SetPoint (button, "top", menuBackground, "top", 0, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 40)
PixelUtil.SetPoint(button, "top", menuBackground, "top", 0, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index - 40)
else
PixelUtil.SetPoint (button, "top", menuBackground, "top", 0, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index)
PixelUtil.SetPoint(button, "top", menuBackground, "top", 0, f.MenuY + ( (index-1) * -f.MenuButtonHeight ) - index)
end
end
@@ -750,13 +750,13 @@
end
--check if passed a plugin name, remove spaces and make it lower case
wildcard = string.lower (wildcard)
wildcard = wildcard:gsub ("%s", "")
wildcard = string.lower(wildcard)
wildcard = wildcard:gsub("%s", "")
for index, pluginInfoTable in ipairs(_detalhes.ToolBar.Menu) do
local pluginName = pluginInfoTable [1]
pluginName = string.lower (pluginName)
pluginName = pluginName:gsub ("%s", "")
pluginName = string.lower(pluginName)
pluginName = pluginName:gsub("%s", "")
if (pluginName == wildcard) then
local pluginObject = pluginInfoTable [3]
+8 -8
View File
@@ -323,9 +323,9 @@
end
if (custom ~= "") then
custom = custom:gsub ("{spell}", spellname)
custom = custom:gsub ("{target}", alvo_name or "")
custom = custom:gsub ("{next}", next)
custom = custom:gsub("{spell}", spellname)
custom = custom:gsub("{target}", alvo_name or "")
custom = custom:gsub("{next}", next)
_detalhes:SendMsgToChannel (custom, channel, _detalhes.announce_interrupts.whisper)
else
local msg = _cstr (Loc ["STRING_OPTIONS_RT_INTERRUPT"], spellname)
@@ -348,9 +348,9 @@
end
if (custom ~= "") then
custom = custom:gsub ("{spell}", spellname)
custom = custom:gsub ("{next}", who_name)
custom = custom:gsub ("{target}", alvo_name or "")
custom = custom:gsub("{spell}", spellname)
custom = custom:gsub("{next}", who_name)
custom = custom:gsub("{target}", alvo_name or "")
_detalhes:SendMsgToChannel (custom, "PRINT")
else
local minute, second = _detalhes:GetCombat():GetFormatedCombatTime()
@@ -424,8 +424,8 @@
local custom = _detalhes.announce_cooldowns.custom
if (custom ~= "") then
custom = custom:gsub ("{spell}", spellname)
custom = custom:gsub ("{target}", alvo_name or "")
custom = custom:gsub("{spell}", spellname)
custom = custom:gsub("{target}", alvo_name or "")
_detalhes:SendMsgToChannel (custom, channel, _detalhes.announce_interrupts.whisper)
else
local msg
+11 -11
View File
@@ -276,12 +276,12 @@
function _detalhes.StatusBar:SetPlugin (instance, absolute_name, anchor)
if (absolute_name == -1) then --none
anchor = string.lower (anchor)
anchor = string.lower(anchor)
ChoosePlugin (nil, nil, -1, instance.StatusBar [anchor], anchor)
else
local index = _detalhes.StatusBar:GetIndexFromAbsoluteName (absolute_name)
if (index and anchor) then
anchor = string.lower (anchor)
anchor = string.lower(anchor)
ChoosePlugin (nil, nil, index, instance.StatusBar [anchor], anchor)
end
end
@@ -530,7 +530,7 @@
function _detalhes.StatusBar:ApplyOptions (child, option, value)
option = string.lower (option)
option = string.lower(option)
if (option == "textxmod") then
@@ -558,7 +558,7 @@
child.options.textColor = value
local r, g, b, a = _detalhes.gump:ParseColors(child.options.textColor)
child.text:SetTextColor (r, g, b, a)
child.text:SetTextColor(r, g, b, a)
elseif (option == "textsize") then
@@ -1115,17 +1115,17 @@ do
if (threatpct) then
child.text:SetText(_math_floor(threatpct).."%")
if (Threat.isTank) then
child.text:SetTextColor (abs(threatpct-100)*0.01, threatpct*0.01, 0, 1)
child.text:SetTextColor(abs(threatpct-100)*0.01, threatpct*0.01, 0, 1)
else
child.text:SetTextColor (threatpct*0.01, abs(threatpct-100)*0.01, 0, 1)
child.text:SetTextColor(threatpct*0.01, abs(threatpct-100)*0.01, 0, 1)
end
else
child.text:SetText("0%")
child.text:SetTextColor (1, 1, 1, 1)
child.text:SetTextColor(1, 1, 1, 1)
end
else
child.text:SetText("0%")
child.text:SetTextColor (1, 1, 1, 1)
child.text:SetTextColor(1, 1, 1, 1)
end
end
end
@@ -1298,7 +1298,7 @@ do
texture:SetPoint("right", myframe.text.widget, "left", -2, -1)
texture:SetWidth(10)
texture:SetHeight(10)
texture:SetTexCoord (0.216796875, 0.26171875, 0.0078125, 0.052734375)
texture:SetTexCoord(0.216796875, 0.26171875, 0.0078125, 0.052734375)
myframe.texture = texture
myframe.widget:SetScript("OnEvent", function()
@@ -1548,7 +1548,7 @@ end)
ColorPickerFrame:Show()
end
_detalhes.gump:NewImage (window, nil, 160, 16, nil, nil, "textcolortexture", "$parentTextColorTexture")
_detalhes.gump:NewImage(window, nil, 160, 16, nil, nil, "textcolortexture", "$parentTextColorTexture")
window.textcolortexture:SetPoint("left", window.textcolor, "right", 2)
window.textcolortexture:SetTexture(1, 1, 1)
@@ -1632,7 +1632,7 @@ end)
_G.DetailsStatusBarOptionsTextStyleDropdown.MyObject:Select(child.options.textStyle, true)
_G.DetailsStatusBarOptionsTextColorTexture:SetColorTexture (child.options.textColor[1], child.options.textColor[2], child.options.textColor[3], child.options.textColor[4])
_G.DetailsStatusBarOptionsTextColorTexture:SetColorTexture(child.options.textColor[1], child.options.textColor[2], child.options.textColor[3], child.options.textColor[4])
_G.DetailsStatusBarOptionsSliderFontSize.MyObject:SetFixedParameter(child)
_G.DetailsStatusBarOptionsSliderFontSize.MyObject:SetValue(child.options.textSize)
+1 -1
View File
@@ -203,7 +203,7 @@ end
_detalhes:SetFontFace (f.desc, _detalhes.font_faces.menus)
--f.background:SetTexture(_detalhes.tooltip.menus_bg_texture)
f.background:SetTexCoord (unpack(_detalhes.tooltip.menus_bg_coords))
f.background:SetTexCoord(unpack(_detalhes.tooltip.menus_bg_coords))
f.background:SetVertexColor(unpack(_detalhes.tooltip.menus_bg_color))
--f.background:SetDesaturated(true)
+3 -3
View File
@@ -99,8 +99,8 @@
end
function timeMachine:Reiniciar()
table.wipe (self.tabelas[1])
table.wipe (self.tabelas[2])
table.wipe(self.tabelas[1])
table.wipe(self.tabelas[2])
self.tabelas = {{}, {}} --1 dano 2 cura
end
@@ -125,7 +125,7 @@
end
local esta_tabela = timeMachine.tabelas [self.tipo]
tinsert (esta_tabela, self)
tinsert(esta_tabela, self)
self.timeMachine = #esta_tabela
end
+13 -13
View File
@@ -293,7 +293,7 @@
function _detalhes:GetNpcIdFromGuid (guid)
local NpcId = select( 6, strsplit( "-", guid ) )
if (NpcId) then
return tonumber ( NpcId )
return tonumber( NpcId )
end
return 0
end
@@ -344,15 +344,15 @@
return _math_random (1000, 9000) / 1000000
end
--/script print(tonumber (4/1000000)) - 4e-006
--/script print(tonumber(4/1000000)) - 4e-006
--0.000004
--set all table keys to lower
local temptable = {}
function _detalhes:LowerizeKeys (_table)
for key, value in pairs(_table) do
temptable [string.lower (key)] = value
temptable [string.lower(key)] = value
end
temptable, _table = table.wipe (_table), temptable
temptable, _table = table.wipe(_table), temptable
return _table
end
@@ -381,7 +381,7 @@
--do the override
if (_detalhes.numerical_system_symbols ~= "auto") then
local locale = string.lower (_detalhes.numerical_system_symbols)
local locale = string.lower(_detalhes.numerical_system_symbols)
if (locale == "kr") then
symbol_1K, symbol_10K, symbol_1B = "", "", ""
@@ -540,7 +540,7 @@
--short numbers
function _detalhes:ToK (numero)
if (numero > 999999999) then
return format ("%.2f", numero/1000000000) .. "B"
return format("%.2f", numero/1000000000) .. "B"
elseif (numero > 1000000) then
return _string_format ("%.2f", numero/1000000) .. "M"
elseif (numero > 999) then
@@ -552,7 +552,7 @@
function _detalhes:ToK2 (numero)
if (numero > 999999999) then
return format ("%.2f", numero/1000000000) .. "B"
return format("%.2f", numero/1000000000) .. "B"
elseif (numero > 999999) then
return _string_format ("%.2f", numero/1000000) .. "M"
elseif (numero > 99999) then
@@ -567,7 +567,7 @@
--short numbers no numbers after comma
function _detalhes:ToK0 (numero)
if (numero > 999999999) then
return format ("%.2f", numero/1000000000) .. "B"
return format("%.2f", numero/1000000000) .. "B"
elseif (numero > 1000000) then
return _string_format ("%.0f", numero/1000000) .. "M"
elseif (numero > 1000) then
@@ -761,7 +761,7 @@
parameters_cache [3] = v6
parameters_cache [4] = v7
return (str:gsub ("{data(%d+)}", replace_arg):gsub ("{func(.-)}", run_function))
return (str:gsub("{data(%d+)}", replace_arg):gsub("{func(.-)}", run_function))
end
--remove a index from a hash table
@@ -809,7 +809,7 @@
end
--yah, i know
function _detalhes.table.copy (t1, t2)
function _detalhes.table.copy(t1, t2)
for key, value in pairs(t2) do
if (type(value) == "table") then
t1 [key] = Details.CopyTable(value)
@@ -1020,7 +1020,7 @@ end
--font color
function _detalhes:SetFontColor(fontString, r, g, b, a)
r, g, b, a = gump:ParseColors(r, g, b, a)
fontString:SetTextColor (r, g, b, a)
fontString:SetTextColor(r, g, b, a)
end
--font size
@@ -1085,7 +1085,7 @@ end
--internal functions
function _detalhes:HealthTick()
if (UnitExists ("boss1") and IsInRaid() and IsInInstance()) then
if (UnitExists("boss1") and IsInRaid() and IsInInstance()) then
local health = (UnitHealth ("boss1") or 0) / (UnitHealthMax ("boss1") or 0)
if (_detalhes.boss1_health_percent) then
if (_detalhes.boss1_health_percent < health) then
@@ -1304,7 +1304,7 @@ end
GradientFrameControl.gradientes [#GradientFrameControl.gradientes+1] = {
Object = Object,
ObjectType = string.lower (ObjectType),
ObjectType = string.lower(ObjectType),
Func = EndFunction,
FuncParam = FuncParam,
TimeStart = GetTime(),
+6 -6
View File
@@ -834,7 +834,7 @@
elseif (tabela._refresh_window) then
tabela:_refresh_window (esta_barra, self)
else
tabela:RefreshBarra (esta_barra, self, true)
tabela:RefreshBarra(esta_barra, self, true)
end
end
@@ -1112,9 +1112,9 @@
local label = gump:CreateLabel(panel, Loc ["STRING_FEEDBACK_PREFERED_SITE"])
label:SetPoint("topleft", panel, "topleft", 15, -60)
local wowi = gump:NewImage (panel, [[Interface\AddOns\Details\images\icons2]], 101, 34, "artwork", {0/512, 101/512, 163/512, 200/512})
local curse = gump:NewImage (panel, [[Interface\AddOns\Details\images\icons2]], 101, 34, "artwork", {0/512, 101/512, 201/512, 242/512})
local mmoc = gump:NewImage (panel, [[Interface\AddOns\Details\images\icons2]], 101, 34, "artwork", {0/512, 101/512, 243/512, 285/512})
local wowi = gump:NewImage(panel, [[Interface\AddOns\Details\images\icons2]], 101, 34, "artwork", {0/512, 101/512, 163/512, 200/512})
local curse = gump:NewImage(panel, [[Interface\AddOns\Details\images\icons2]], 101, 34, "artwork", {0/512, 101/512, 201/512, 242/512})
local mmoc = gump:NewImage(panel, [[Interface\AddOns\Details\images\icons2]], 101, 34, "artwork", {0/512, 101/512, 243/512, 285/512})
wowi:SetDesaturated(true)
curse:SetDesaturated(true)
mmoc:SetDesaturated(true)
@@ -1259,11 +1259,11 @@
updatewindow_frame.gnoma:SetPoint("topright", updatewindow_frame, "topright", -3, -59)
updatewindow_frame.gnoma:SetTexture("Interface\\AddOns\\Details\\images\\icons2")
updatewindow_frame.gnoma:SetSize(105*1.05, 107*1.05)
updatewindow_frame.gnoma:SetTexCoord (0.2021484375, 0, 0.7919921875, 1)
updatewindow_frame.gnoma:SetTexCoord(0.2021484375, 0, 0.7919921875, 1)
local editbox = Details.gump:NewTextEntry(updatewindow_frame, nil, "$parentTextEntry", "text", 387, 14)
editbox:SetPoint(20, -136)
editbox:SetAutoFocus (false)
editbox:SetAutoFocus(false)
editbox:SetHook("OnEditFocusGained", function()
editbox.text = "http://www.curse.com/addons/wow/details"
editbox:HighlightText()
+13 -13
View File
@@ -100,7 +100,7 @@ function _detalhes.PlayBestDamageOnGuild (damage)
local BaseTexture = DetailsNewDamageRecord:CreateTexture("BaseTextureTexture", "ARTWORK")
BaseTexture:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Background-Mini]])
BaseTexture:SetDrawLayer ("ARTWORK", -5)
BaseTexture:SetDrawLayer("ARTWORK", -5)
BaseTexture:SetPoint("center", DetailsNewDamageRecord, "center", 0, 0)
BaseTexture:SetSize(256, 64)
BaseTexture:SetVertexColor(0.99999779462814, 0.99999779462814, 0.99999779462814, 0.99999779462814)
@@ -128,11 +128,11 @@ function _detalhes.PlayBestDamageOnGuild (damage)
local BigFlash = DetailsNewDamageRecord:CreateTexture("BigFlashTexture", "OVERLAY")
BigFlash:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Glow]])
BigFlash:SetDrawLayer ("OVERLAY", 0)
BigFlash:SetDrawLayer("OVERLAY", 0)
BigFlash:SetPoint("center", DetailsNewDamageRecord, "center", -2, 2)
BigFlash:SetSize(314, 100)
BigFlash:SetDesaturated(false)
BigFlash:SetTexCoord (0.0010000000149012, 0.77400001525879, 0.0010000000149012, 0.65800003051758)
BigFlash:SetTexCoord(0.0010000000149012, 0.77400001525879, 0.0010000000149012, 0.65800003051758)
if (0 ~= 0) then
BigFlash:SetRotation (0)
end
@@ -163,11 +163,11 @@ function _detalhes.PlayBestDamageOnGuild (damage)
local FlashSwipe = DetailsNewDamageRecord:CreateTexture("FlashSwipeTexture", "OVERLAY")
FlashSwipe:SetTexture([[Interface\ACHIEVEMENTFRAME\UI-Achievement-Alert-Glow]])
FlashSwipe:SetDrawLayer ("OVERLAY", 7)
FlashSwipe:SetDrawLayer("OVERLAY", 7)
FlashSwipe:SetPoint("center", DetailsNewDamageRecord, "center", -99, 0)
FlashSwipe:SetSize(100, 57)
FlashSwipe:SetDesaturated(false)
FlashSwipe:SetTexCoord (0.78199996948242, 0.91900001525879, 0.0010000000149012, 0.2760000038147)
FlashSwipe:SetTexCoord(0.78199996948242, 0.91900001525879, 0.0010000000149012, 0.2760000038147)
if (0 ~= 0) then
FlashSwipe:SetRotation (0)
end
@@ -205,11 +205,11 @@ function _detalhes.PlayBestDamageOnGuild (damage)
local Portrait = DetailsNewDamageRecord:CreateTexture("PortraitTexture", "OVERLAY")
Portrait:SetTexture([[Interface\ARCHEOLOGY\ARCH-FLAREEFFECT]])
Portrait:SetDrawLayer ("OVERLAY", -5)
Portrait:SetDrawLayer("OVERLAY", -5)
Portrait:SetPoint("center", DetailsNewDamageRecord, "center", 3, 0)
Portrait:SetSize(246, 44)
Portrait:SetDesaturated(false)
Portrait:SetTexCoord (0.051753740310669, 0.81701484680176, 0.086334381103516, 0.25102617263794)
Portrait:SetTexCoord(0.051753740310669, 0.81701484680176, 0.086334381103516, 0.25102617263794)
if (0 ~= 0) then
Portrait:SetRotation (0)
end
@@ -256,11 +256,11 @@ function _detalhes.PlayBestDamageOnGuild (damage)
local DamageIcon = DetailsNewDamageRecord:CreateTexture("DamageIconTexture", "OVERLAY")
DamageIcon:SetTexture([[Interface\LFGFRAME\UI-LFG-ICON-ROLES]])
DamageIcon:SetDrawLayer ("OVERLAY", 2)
DamageIcon:SetDrawLayer("OVERLAY", 2)
DamageIcon:SetPoint("center", DetailsNewDamageRecord, "center", -97, 1)
DamageIcon:SetSize(32, 32)
DamageIcon:SetDesaturated(false)
DamageIcon:SetTexCoord (0.27200000762939, 0.51899997711182, 0.25837841033936, 0.51399997711182)
DamageIcon:SetTexCoord(0.27200000762939, 0.51899997711182, 0.25837841033936, 0.51399997711182)
if (0 ~= 0) then
DamageIcon:SetRotation (0)
end
@@ -292,10 +292,10 @@ function _detalhes.PlayBestDamageOnGuild (damage)
local NewDamageRecord = DetailsNewDamageRecord:CreateFontString("NewDamageRecordFontString", "OVERLAY")
NewDamageRecord:SetFont ([=[Fonts\FRIZQT__.TTF]=], 12, "OUTLINE")
NewDamageRecord:SetText("Damage Record!")
NewDamageRecord:SetDrawLayer ("OVERLAY", 0)
NewDamageRecord:SetDrawLayer("OVERLAY", 0)
NewDamageRecord:SetPoint("center", DetailsNewDamageRecord, "center", 18, 7)
NewDamageRecord:SetSize(181, 20)
NewDamageRecord:SetTextColor (1, 1, 1)
NewDamageRecord:SetTextColor(1, 1, 1)
NewDamageRecord:SetAlpha(1)
NewDamageRecord:SetJustifyH("CENTER")
@@ -331,10 +331,10 @@ function _detalhes.PlayBestDamageOnGuild (damage)
local DamageAmount = DetailsNewDamageRecord:CreateFontString("DamageAmountFontString", "OVERLAY")
DamageAmount:SetFont ([=[Fonts\FRIZQT__.TTF]=], 12, "THICKOUTLINE")
DamageAmount:SetText(_detalhes:comma_value (damage))
DamageAmount:SetDrawLayer ("OVERLAY", 0)
DamageAmount:SetDrawLayer("OVERLAY", 0)
DamageAmount:SetPoint("center", DetailsNewDamageRecord, "center", 18, -7)
DamageAmount:SetSize(100, 20)
DamageAmount:SetTextColor (1, 1, 1)
DamageAmount:SetTextColor(1, 1, 1)
DamageAmount:SetAlpha(1)
DamageAmount:SetJustifyH("CENTER")
+15 -15
View File
@@ -28,7 +28,7 @@ function gump:NewLabel2 (parent, container, member, text, font, size, color)
end
if (color) then
newFontString:SetTextColor (unpack(color))
newFontString:SetTextColor(unpack(color))
end
newFontString:SetJustifyH("LEFT")
@@ -124,7 +124,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
end
if (new_button.texture) then
new_button.texture:SetTexCoord (0, 1, 0.5, 0.74609375)
new_button.texture:SetTexCoord(0, 1, 0.5, 0.74609375)
end
if (options.OnGrab and options.OnGrab == "PassClick") then
@@ -157,9 +157,9 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
if (new_button.texture) then
if (new_button.enter) then
new_button.texture:SetTexCoord (0, 1, 0.25, 0.49609375)
new_button.texture:SetTexCoord(0, 1, 0.25, 0.49609375)
else
new_button.texture:SetTexCoord (0, 1, 0, 0.24609375)
new_button.texture:SetTexCoord(0, 1, 0, 0.24609375)
end
end
@@ -195,7 +195,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
end
if (new_button.texture) then
new_button.texture:SetTexCoord (0, 1, 0.25+(0.0078125/2), 0.5+(0.0078125/2))
new_button.texture:SetTexCoord(0, 1, 0.25+(0.0078125/2), 0.5+(0.0078125/2))
end
if (new_button.MouseOnEnterHook) then
@@ -212,7 +212,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
end
if (new_button.texture) then
new_button.texture:SetTexCoord (0, 1, 0, 0.24609375)
new_button.texture:SetTexCoord(0, 1, 0, 0.24609375)
end
if (new_button.MouseOnLeaveHook) then
@@ -242,7 +242,7 @@ function gump:NewDetailsButton (parent, container, instancia, func, param1, para
new_button.texture:SetPoint("bottomright", new_button, "bottomright", rect.x2, rect.y2)
end
new_button.texture:SetTexCoord (0, 1, 0, 0.24609375)
new_button.texture:SetTexCoord(0, 1, 0, 0.24609375)
new_button.texture:SetTexture(texture)
end
@@ -264,8 +264,8 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
container [member] = editbox
options = options or {}
editbox:SetAutoFocus (false)
editbox:SetFontObject (GameFontHighlightSmall)
editbox:SetAutoFocus(false)
editbox:SetFontObject(GameFontHighlightSmall)
editbox:SetWidth(w)
editbox:SetHeight(h)
@@ -286,7 +286,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
gump:NewLabel(editbox, editbox, nil, "label", "", "GameFontHighlightSmall")
editbox ["label"]: SetPoint ("right", editbox, "left", -2, 0)
editbox.label:SetTextColor (.8, .8, .8, 1)
editbox.label:SetTextColor(.8, .8, .8, 1)
function editbox:SetPointAndSpace (MyAnchor, SnapTo, HisAnchor, x, y, Width)
@@ -348,7 +348,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
end
end
function editbox:PressEnter (byScript)
function editbox:PressEnter(byScript)
EnterPress (byScript)
end
@@ -410,7 +410,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
editbox:SetScript("OnEditFocusGained", function()
if (editbox.label) then
editbox.label:SetTextColor (1, 1, 1, 1)
editbox.label:SetTextColor(1, 1, 1, 1)
end
if (editbox.OnFocusGainedHook) then
editbox.OnFocusGainedHook()
@@ -435,7 +435,7 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
end
if (editbox.label) then
editbox.label:SetTextColor (.8, .8, .8, 1)
editbox.label:SetTextColor(.8, .8, .8, 1)
end
if (editbox.OnFocusLostHook) then
@@ -472,12 +472,12 @@ function gump:NewTextBox (parent, container, member, func, param1, param2, w, h,
editbox.SetLabel = function(_, Label)
if (Label) then
editbox.label = Label
editbox.label:SetTextColor (.8, .8, .8, 1)
editbox.label:SetTextColor(.8, .8, .8, 1)
end
end
function editbox:Blink()
editbox.label:SetTextColor (1, .2, .2, 1)
editbox.label:SetTextColor(1, .2, .2, 1)
end
if (options.Label) then
+4 -4
View File
@@ -67,13 +67,13 @@ function Details:CreateAPI2Frame()
parameters = parameters .. parameterInfo.name .. ", "
end
end
parameters = parameters:gsub (", $", "")
parameters = parameters:gsub(", $", "")
local returnValues = "local "
for returnIndex, returnInfo in ipairs(apiInfo.returnValues) do
returnValues = returnValues .. returnInfo.name .. ", "
end
returnValues = returnValues:gsub (", $", "")
returnValues = returnValues:gsub(", $", "")
returnValues = returnValues .. " = "
if (parameters ~= "") then
@@ -82,7 +82,7 @@ function Details:CreateAPI2Frame()
Api2Frame.ApiCopy.text = returnValues .. "Details." .. apiName .. "()"
end
Api2Frame.ApiCopy:SetFocus (true)
Api2Frame.ApiCopy:SetFocus(true)
Api2Frame.ApiCopy:HighlightText()
--parameters
@@ -219,7 +219,7 @@ function Details:CreateAPI2Frame()
--api func to copy
local apiCopyString = DetailsFramework:CreateLabel(Api2Frame, "Copy String", 12, "orange")
apiCopyString:SetPoint("topleft", Api2Frame.ApiFunctionDesc, "bottomleft", 0, -20)
Api2Frame.ApiCopy = DetailsFramework:CreateTextEntry (Api2Frame, function() end, infoWidth, 20)
Api2Frame.ApiCopy = DetailsFramework:CreateTextEntry(Api2Frame, function() end, infoWidth, 20)
Api2Frame.ApiCopy:SetPoint("topleft", apiCopyString, "bottomleft", 0, -2)
Api2Frame.ApiCopy:SetTemplate(DetailsFramework:GetTemplate("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX"))
+5 -5
View File
@@ -49,16 +49,16 @@ local libwindow = LibStub("LibWindow-1.1")
f.Close:SetNormalTexture(_detalhes.gump.folder .. "icons")
f.Close:SetHighlightTexture(_detalhes.gump.folder .. "icons")
f.Close:SetPushedTexture(_detalhes.gump.folder .. "icons")
f.Close:GetNormalTexture():SetTexCoord (0, 16/128, 0, 1)
f.Close:GetHighlightTexture():SetTexCoord (0, 16/128, 0, 1)
f.Close:GetPushedTexture():SetTexCoord (0, 16/128, 0, 1)
f.Close:GetNormalTexture():SetTexCoord(0, 16/128, 0, 1)
f.Close:GetHighlightTexture():SetTexCoord(0, 16/128, 0, 1)
f.Close:GetPushedTexture():SetTexCoord(0, 16/128, 0, 1)
f.Close:SetAlpha(0.7)
f.Close:SetScript("OnClick", function() f:Hide() end)
--title
f.Title = f.TitleBar:CreateFontString("$parentTitle", "overlay", "GameFontNormal")
f.Title:SetPoint("center", f.TitleBar, "center")
f.Title:SetTextColor (.8, .8, .8, 1)
f.Title:SetTextColor(.8, .8, .8, 1)
f.Title:SetText("Details! Benchmark")
DF:InstallTemplate ("font", "DETAILS_BENCHMARK_NORMAL", {color = "white", size = 10, font = "Friz Quadrata TT"})
@@ -151,7 +151,7 @@ local libwindow = LibStub("LibWindow-1.1")
--description string and text entry
summaryFrame.DescriptionLabel = DF:CreateLabel(summaryFrame, "Description", normal_text_template)
summaryFrame.DescriptionEntry = DF:CreateTextEntry (summaryFrame, function()end, 120, 20, nil, _, nil, options_dropdown_template)
summaryFrame.DescriptionEntry = DF:CreateTextEntry(summaryFrame, function()end, 120, 20, nil, _, nil, options_dropdown_template)
--DPS Amount string
summaryFrame.DPSLabel = DF:CreateLabel(summaryFrame, "100K", normal_text_template)
+1 -1
View File
@@ -213,7 +213,7 @@ function Details:OpenBrokerTextEditor()
local panel = DetailsWindowOptionsBrokerTextEditor
local text = Details.data_broker_text:gsub ("||", "|")
local text = Details.data_broker_text:gsub("||", "|")
panel.default_text = text
panel.editbox:SetText(text)
+1 -1
View File
@@ -33,7 +33,7 @@ do
end
end)
DetailsFrameWork:NewImage (panel, "Interface\\AddOns\\Details\\images\\copy", 512, 128, "overlay", nil, "background", "$parentBackGround")
DetailsFrameWork:NewImage(panel, "Interface\\AddOns\\Details\\images\\copy", 512, 128, "overlay", nil, "background", "$parentBackGround")
panel.background:SetPoint(0, -25)
--title
+4 -4
View File
@@ -489,11 +489,11 @@ function Details:CreateCurrentDpsFrame(parent, name)
yellow_team_color = Details.class_colors.ARENA_YELLOW
if (f.PlayerTeam == 0) then
labelPlayerTeam:SetTextColor (unpack(yellow_team_color))
labelYellowTeam:SetTextColor (unpack(green_team_color))
labelPlayerTeam:SetTextColor(unpack(yellow_team_color))
labelYellowTeam:SetTextColor(unpack(green_team_color))
else
labelPlayerTeam:SetTextColor (unpack(green_team_color))
labelYellowTeam:SetTextColor (unpack(yellow_team_color))
labelPlayerTeam:SetTextColor(unpack(green_team_color))
labelYellowTeam:SetTextColor(unpack(yellow_team_color))
end
end
+48 -48
View File
@@ -475,7 +475,7 @@
object.attribute = DetailsCustomPanel.current_attribute
object.source = source
object.target = target
object.spellid = tonumber (spellid)
object.spellid = tonumber(spellid)
object.script = false
object.tooltip = false
@@ -502,7 +502,7 @@
["attribute"] = DetailsCustomPanel.current_attribute,
["source"] = source,
["target"] = target,
["spellid"] = tonumber (spellid),
["spellid"] = tonumber(spellid),
["script"] = false,
["tooltip"] = false,
}
@@ -826,7 +826,7 @@
if (not custom_window.ExportBox) then
local editbox = _detalhes.gump:NewTextEntry(custom_window, nil, "$parentExportBox", "ExportBox", CONST_EDITBOX_WIDTH, 20)
editbox:SetPoint("bottomleft", custom_window, "bottomleft", 10, 6)
editbox:SetAutoFocus (false)
editbox:SetAutoFocus(false)
editbox:SetTemplate(CONST_TEXTENTRY_TEMPLATE)
editbox:SetHook("OnEditFocusLost", function()
editbox:Hide()
@@ -836,7 +836,7 @@
end)
local flashTexture = editbox:CreateTexture(nil, "overlay")
flashTexture:SetColorTexture (1, 1, 1)
flashTexture:SetColorTexture(1, 1, 1)
flashTexture:SetAllPoints()
flashTexture:SetAlpha(0)
@@ -873,7 +873,7 @@
local editbox = _detalhes.gump:NewTextEntry(custom_window, nil, "$parentImportBox", "ImportBox", CONST_EDITBOX_WIDTH - export_string.width - CONST_EDITBOX_BUTTON_WIDTH - 4, 20)
editbox:SetPoint("left", export_string, "right", 2, 0)
editbox:SetAutoFocus (false)
editbox:SetAutoFocus(false)
editbox:SetTemplate(CONST_TEXTENTRY_TEMPLATE)
local import = function()
@@ -964,21 +964,21 @@
selected_left:SetTexture([[Interface\Store\Store-Main]])
selected_left:SetSize(50, 20)
selected_left:SetVertexColor(1, .8, 0, 1)
selected_left:SetTexCoord (960/1024, 1020/1024, 68/1024, 101/1024)
selected_left:SetTexCoord(960/1024, 1020/1024, 68/1024, 101/1024)
custom_window.selected_left = selected_left
local selected_right = attribute_box:CreateTexture(nil, "overlay")
selected_right:SetTexture([[Interface\Store\Store-Main]])
selected_right:SetSize(31, 20)
selected_right:SetVertexColor(1, .8, 0, 1)
selected_right:SetTexCoord (270/1024, 311/1024, 873/1024, 906/1024)
selected_right:SetTexCoord(270/1024, 311/1024, 873/1024, 906/1024)
custom_window.selected_right = selected_right
local selected_center = attribute_box:CreateTexture(nil, "overlay")
selected_center:SetTexture([[Interface\Store\Store-Main]])
selected_center:SetSize(49, 20)
selected_center:SetVertexColor(1, .8, 0, 1)
selected_center:SetTexCoord (956/1024, 1004/1024, 164/1024, 197/1024)
selected_center:SetTexCoord(956/1024, 1004/1024, 164/1024, 197/1024)
selected_center:SetPoint("left", selected_left, "right")
selected_center:SetPoint("right", selected_right, "left")
@@ -1012,12 +1012,12 @@
button.icon:SetPoint("left", button, "left", 6, 0)
button.icon:SetSize(22, 22)
button.icon:SetTexture([[Interface\AddOns\Details\images\custom_icones]])
button.icon:SetTexCoord (p*(i-1), p*(i), 0, 1)
button.icon:SetTexCoord(p*(i-1), p*(i), 0, 1)
button.text = button:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
button.text:SetPoint("left", button.icon, "right", 4, 0)
button.text:SetText(attributes [i] and attributes [i].label or "")
button.text:SetTextColor (.9, .9, .9, 1)
button.text:SetTextColor(.9, .9, .9, 1)
end
end
@@ -1071,7 +1071,7 @@
local pickicon = function()
gump:IconPick (pickicon_callback, true)
end
local icon_image = gump:NewImage (box0, [[Interface\ICONS\TEMP]], 20, 20, nil, nil, "icontexture", "$parentIconTexture")
local icon_image = gump:NewImage(box0, [[Interface\ICONS\TEMP]], 20, 20, nil, nil, "icontexture", "$parentIconTexture")
local icon_button = gump:NewButton(box0, nil, "$parentIconButton", "IconButton", 20, 20, pickicon)
icon_button:InstallCustomTexture()
icon_button:SetPoint("left", icon_label, "left", 64, 0)
@@ -1108,7 +1108,7 @@
end
local enable_source_field = function()
box1.sourceentry:Enable()
box1.sourceentry:SetFocus (true)
box1.sourceentry:SetFocus(true)
end
local source_icon = [[Interface\COMMON\Indicator-Yellow]]
@@ -1137,7 +1137,7 @@
local adds_boss_image = adds_boss:CreateTexture(nil, "overlay")
adds_boss_image:SetPoint("center", adds_boss)
adds_boss_image:SetTexture("Interface\\Buttons\\UI-MicroButton-Raid-Up")
adds_boss_image:SetTexCoord (0.046875, 0.90625, 0.40625, 0.953125)
adds_boss_image:SetTexCoord(0.046875, 0.90625, 0.40625, 0.953125)
adds_boss_image:SetWidth(20)
adds_boss_image:SetHeight(16)
@@ -1179,7 +1179,7 @@
local buttonMouseOver = function(button)
button.MyObject.image:SetBlendMode("ADD")
button.MyObject.line:SetBlendMode("ADD")
button.MyObject.label:SetTextColor (1, 1, 1, 1)
button.MyObject.label:SetTextColor(1, 1, 1, 1)
GameTooltip:SetOwner(button, "ANCHOR_TOPLEFT")
GameTooltip:AddLine(button.MyObject.actor)
GameTooltip:Show()
@@ -1187,7 +1187,7 @@
local name, description, bgImage, buttonImage, loreImage, dungeonAreaMapID, link = DetailsFramework.EncounterJournal.EJ_GetInstanceInfo (button.MyObject.ej_id)
modelFrameTexture:SetTexture(bgImage)
modelFrameTexture:SetTexCoord (3/512, 370/512, 5/512, 429/512)
modelFrameTexture:SetTexCoord(3/512, 370/512, 5/512, 429/512)
modelFrame:Show()
modelFrame:SetDisplayInfo (button.MyObject.model)
@@ -1195,7 +1195,7 @@
local buttonMouseOut = function(button)
button.MyObject.image:SetBlendMode("BLEND")
button.MyObject.line:SetBlendMode("BLEND")
button.MyObject.label:SetTextColor (.8, .8, .8, .8)
button.MyObject.label:SetTextColor(.8, .8, .8, .8)
GameTooltip:Hide()
modelFrame:Hide()
end
@@ -1226,7 +1226,7 @@
thisButton:SetHook("OnEnter", buttonMouseOver)
thisButton:SetHook("OnLeave", buttonMouseOut)
local t = gump:NewImage (thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomActors2EncounterImageButton"..i)
local t = gump:NewImage(thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomActors2EncounterImageButton"..i)
t:SetPoint("left", thisButton)
t:SetTexture([[Interface\MINIMAP\TRACKING\Target]])
t:SetDesaturated(true)
@@ -1238,14 +1238,14 @@
text:SetWidth(123)
text:SetHeight(10)
local border = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 40, 38, nil, nil, "border", "DetailsCustomActors2EncounterBorderButton"..i)
border:SetTexCoord (0.00390625, 0.27734375, 0.44140625,0.69531250)
border:SetDrawLayer ("background")
local border = gump:NewImage(thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 40, 38, nil, nil, "border", "DetailsCustomActors2EncounterBorderButton"..i)
border:SetTexCoord(0.00390625, 0.27734375, 0.44140625,0.69531250)
border:SetDrawLayer("background")
border:SetPoint("topleft", thisButton.button, "topleft", -9, 9)
local line = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 134, 25, nil, nil, "line", "DetailsCustomActors2EncounterLineButton"..i)
line:SetTexCoord (0.31250000, 0.96484375, 0.37109375, 0.52343750)
line:SetDrawLayer ("background")
local line = gump:NewImage(thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 134, 25, nil, nil, "line", "DetailsCustomActors2EncounterLineButton"..i)
line:SetTexCoord(0.31250000, 0.96484375, 0.37109375, 0.52343750)
line:SetDrawLayer("background")
line:SetPoint("left", thisButton.button, "right", -110, -3)
table.insert (actorsFrameButtons, #actorsFrameButtons+1, thisButton)
@@ -1328,7 +1328,7 @@
end
local enable_target_field = function()
box1.targetentry:Enable()
box1.targetentry:SetFocus (true)
box1.targetentry:SetFocus(true)
end
local target_icon = [[Interface\COMMON\Indicator-Yellow]]
@@ -1359,7 +1359,7 @@
local adds_boss_image = adds_boss:CreateTexture(nil, "overlay")
adds_boss_image:SetPoint("center", adds_boss)
adds_boss_image:SetTexture("Interface\\Buttons\\UI-MicroButton-Raid-Up")
adds_boss_image:SetTexCoord (0.046875, 0.90625, 0.40625, 0.953125)
adds_boss_image:SetTexCoord(0.046875, 0.90625, 0.40625, 0.953125)
adds_boss_image:SetWidth(20)
adds_boss_image:SetHeight(16)
@@ -1387,7 +1387,7 @@
local buttonMouseOver = function(button)
button.MyObject.image:SetBlendMode("ADD")
button.MyObject.line:SetBlendMode("ADD")
button.MyObject.label:SetTextColor (1, 1, 1, 1)
button.MyObject.label:SetTextColor(1, 1, 1, 1)
GameTooltip:SetOwner(button, "ANCHOR_TOPLEFT")
GameTooltip:AddLine(button.MyObject.actor)
GameTooltip:Show()
@@ -1395,7 +1395,7 @@
local name, description, bgImage, buttonImage, loreImage, dungeonAreaMapID, link = DetailsFramework.EncounterJournal.EJ_GetInstanceInfo (button.MyObject.ej_id)
modelFrameTexture:SetTexture(bgImage)
modelFrameTexture:SetTexCoord (3/512, 370/512, 5/512, 429/512)
modelFrameTexture:SetTexCoord(3/512, 370/512, 5/512, 429/512)
modelFrame:Show()
modelFrame:SetDisplayInfo (button.MyObject.model)
@@ -1403,7 +1403,7 @@
local buttonMouseOut = function(button)
button.MyObject.image:SetBlendMode("BLEND")
button.MyObject.line:SetBlendMode("BLEND")
button.MyObject.label:SetTextColor (.8, .8, .8, .8)
button.MyObject.label:SetTextColor(.8, .8, .8, .8)
GameTooltip:Hide()
modelFrame:Hide()
@@ -1434,7 +1434,7 @@
thisButton:SetHook("OnEnter", buttonMouseOver)
thisButton:SetHook("OnLeave", buttonMouseOut)
local t = gump:NewImage (thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomActorsEncounterImageButton"..i)
local t = gump:NewImage(thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomActorsEncounterImageButton"..i)
t:SetPoint("left", thisButton)
t:SetTexture([[Interface\MINIMAP\TRACKING\Target]])
t:SetDesaturated(true)
@@ -1446,14 +1446,14 @@
text:SetWidth(123)
text:SetHeight(10)
local border = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 40, 38, nil, nil, "border", "DetailsCustomActorsEncounterBorderButton"..i)
border:SetTexCoord (0.00390625, 0.27734375, 0.44140625,0.69531250)
border:SetDrawLayer ("background")
local border = gump:NewImage(thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 40, 38, nil, nil, "border", "DetailsCustomActorsEncounterBorderButton"..i)
border:SetTexCoord(0.00390625, 0.27734375, 0.44140625,0.69531250)
border:SetDrawLayer("background")
border:SetPoint("topleft", thisButton.button, "topleft", -9, 9)
local line = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 84, 25, nil, nil, "line", "DetailsCustomActorsEncounterLineButton"..i)
line:SetTexCoord (0.31250000, 0.96484375, 0.37109375, 0.52343750)
line:SetDrawLayer ("background")
local line = gump:NewImage(thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 84, 25, nil, nil, "line", "DetailsCustomActorsEncounterLineButton"..i)
line:SetTexCoord(0.31250000, 0.96484375, 0.37109375, 0.52343750)
line:SetDrawLayer("background")
line:SetPoint("left", thisButton.button, "right", -110, -3)
table.insert (actorsFrameButtons, #actorsFrameButtons+1, thisButton)
@@ -1541,7 +1541,7 @@
local spell_id_boss_image = spell_id_boss:CreateTexture(nil, "overlay")
spell_id_boss_image:SetPoint("center", spell_id_boss)
spell_id_boss_image:SetTexture("Interface\\Buttons\\UI-MicroButton-Raid-Up")
spell_id_boss_image:SetTexCoord (0.046875, 0.90625, 0.40625, 0.953125)
spell_id_boss_image:SetTexCoord(0.046875, 0.90625, 0.40625, 0.953125)
spell_id_boss_image:SetWidth(20)
spell_id_boss_image:SetHeight(16)
@@ -1562,7 +1562,7 @@
local buttonMouseOver = function(button)
button.MyObject.image:SetBlendMode("ADD")
button.MyObject.line:SetBlendMode("ADD")
button.MyObject.label:SetTextColor (1, 1, 1, 1)
button.MyObject.label:SetTextColor(1, 1, 1, 1)
GameTooltip:SetOwner(button, "ANCHOR_TOPLEFT")
_detalhes:GameTooltipSetSpellByID (button.MyObject.spellid)
@@ -1571,7 +1571,7 @@
local buttonMouseOut = function(button)
button.MyObject.image:SetBlendMode("BLEND")
button.MyObject.line:SetBlendMode("BLEND")
button.MyObject.label:SetTextColor (.8, .8, .8, .8)
button.MyObject.label:SetTextColor(.8, .8, .8, .8)
GameTooltip:Hide()
end
@@ -1599,7 +1599,7 @@
thisButton:SetHook("OnEnter", buttonMouseOver)
thisButton:SetHook("OnLeave", buttonMouseOut)
local t = gump:NewImage (thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomEncounterImageButton"..i)
local t = gump:NewImage(thisButton, nil, 20, 20, nil, nil, "image", "DetailsCustomEncounterImageButton"..i)
t:SetPoint("left", thisButton)
local text = gump:NewLabel(thisButton, nil, "DetailsCustomSpellsFrameButton"..i.."Label", "label", "Spell", nil, 9.5, {.8, .8, .8, .8})
@@ -1607,14 +1607,14 @@
text:SetWidth(73)
text:SetHeight(10)
local border = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 40, 38, nil, nil, "border", "DetailsCustomEncounterBorderButton"..i)
border:SetTexCoord (0.00390625, 0.27734375, 0.44140625,0.69531250)
border:SetDrawLayer ("background")
local border = gump:NewImage(thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 40, 38, nil, nil, "border", "DetailsCustomEncounterBorderButton"..i)
border:SetTexCoord(0.00390625, 0.27734375, 0.44140625,0.69531250)
border:SetDrawLayer("background")
border:SetPoint("topleft", thisButton.button, "topleft", -9, 9)
local line = gump:NewImage (thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 84, 25, nil, nil, "line", "DetailsCustomEncounterLineButton"..i)
line:SetTexCoord (0.31250000, 0.96484375, 0.37109375, 0.52343750)
line:SetDrawLayer ("background")
local line = gump:NewImage(thisButton, "Interface\\SPELLBOOK\\Spellbook-Parts", 84, 25, nil, nil, "line", "DetailsCustomEncounterLineButton"..i)
line:SetTexCoord(0.31250000, 0.96484375, 0.37109375, 0.52343750)
line:SetDrawLayer("background")
line:SetPoint("left", thisButton.button, "right", -60, -3)
table.insert (spellsFrameButtons, #spellsFrameButtons+1, thisButton)
@@ -1734,9 +1734,9 @@
local func, errortext = loadstring (script)
if (not func) then
local firstLine = strsplit("\n", script, 2)
errortext = errortext:gsub (firstLine, "")
errortext = errortext:gsub ("%[string \"", "")
errortext = errortext:gsub ("...\"]:", "")
errortext = errortext:gsub(firstLine, "")
errortext = errortext:gsub("%[string \"", "")
errortext = errortext:gsub("...\"]:", "")
errortext = "Line " .. errortext
DetailsCustomPanel.ErrorString.text = errortext
else
+3 -3
View File
@@ -39,7 +39,7 @@ function Details:Dump (...)
text_editor:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
text_editor:SetBackdropBorderColor(0, 0, 0, 1)
text_editor.__background:SetColorTexture (0.2317647, 0.2317647, 0.2317647)
text_editor.__background:SetColorTexture(0.2317647, 0.2317647, 0.2317647)
text_editor.__background:SetVertexColor(0.27, 0.27, 0.27)
text_editor.__background:SetAlpha(0.8)
text_editor.__background:SetVertTile(true)
@@ -104,7 +104,7 @@ function _detalhes:ShowImportWindow (defaultText, confirmFunc, titleText)
importTextEditor:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
importTextEditor:SetBackdropBorderColor(0, 0, 0, 1)
importTextEditor.__background:SetColorTexture (0.2317647, 0.2317647, 0.2317647)
importTextEditor.__background:SetColorTexture(0.2317647, 0.2317647, 0.2317647)
importTextEditor.__background:SetVertexColor(0.27, 0.27, 0.27)
importTextEditor.__background:SetAlpha(0.8)
importTextEditor.__background:SetVertTile(true)
@@ -139,7 +139,7 @@ function _detalhes:ShowImportWindow (defaultText, confirmFunc, titleText)
_G.DetailsExportWindow.Title:SetText(titleText)
C_Timer.After(.2, function()
_G.DetailsExportWindow.ImportEditor:SetFocus (true)
_G.DetailsExportWindow.ImportEditor:SetFocus(true)
_G.DetailsExportWindow.ImportEditor.editbox:HighlightText (0)
end)
end
+10 -10
View File
@@ -416,7 +416,7 @@ function Details:CreateEventTrackerFrame(parent, name)
local class
local spec = _detalhes.cached_specs [serial]
if (not spec) then
local _, engClass = UnitClass (name)
local _, engClass = UnitClass(name)
if (engClass) then
class = engClass
else
@@ -519,7 +519,7 @@ function Details:CreateEventTrackerFrame(parent, name)
local spec, class = get_spec_or_class (ability [ABILITYTABLE_CASTERSERIAL], ability [ABILITYTABLE_CASTERNAME])
local texture, L, R, T, B = get_player_icon (spec, class)
line.LeftIcon:SetTexture(texture)
line.LeftIcon:SetTexCoord (L, R, T, B)
line.LeftIcon:SetTexCoord(L, R, T, B)
line.LeftText:SetText(_detalhes:GetOnlyName(ability [ABILITYTABLE_CASTERNAME]))
if (ability [ABILITYTABLE_ISENEMY]) then
@@ -531,7 +531,7 @@ function Details:CreateEventTrackerFrame(parent, name)
if (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_COOLDOWN) then
local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID])
line.RightIcon:SetTexture(spellIcon)
line.RightIcon:SetTexCoord (.06, .94, .06, .94)
line.RightIcon:SetTexCoord(.06, .94, .06, .94)
local targetName = ability [ABILITYTABLE_TARGETNAME]
if (targetName) then
@@ -542,30 +542,30 @@ function Details:CreateEventTrackerFrame(parent, name)
line.RightText:SetText(targetName or spellName)
line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]])
line.ActionIcon:SetTexCoord (0, 0.125, 0, 1)
line.ActionIcon:SetTexCoord(0, 0.125, 0, 1)
elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_OFFENSIVE) then
local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID])
line.RightIcon:SetTexture(spellIcon)
line.RightIcon:SetTexCoord (.06, .94, .06, .94)
line.RightIcon:SetTexCoord(.06, .94, .06, .94)
line.RightText:SetText(spellName)
line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]])
line.ActionIcon:SetTexCoord (0.127, 0.25, 0, 1)
line.ActionIcon:SetTexCoord(0.127, 0.25, 0, 1)
elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_INTERRUPT) then
local spellNameInterrupted, _, spellIconInterrupted = GetSpellInfo(ability [ABILITYTABLE_EXTRASPELLID])
line.RightIcon:SetTexture(spellIconInterrupted)
line.RightIcon:SetTexCoord (.06, .94, .06, .94)
line.RightIcon:SetTexCoord(.06, .94, .06, .94)
line.RightText:SetText(spellNameInterrupted)
line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]])
line.ActionIcon:SetTexCoord (0.251, 0.375, 0, 1)
line.ActionIcon:SetTexCoord(0.251, 0.375, 0, 1)
elseif (ability [ABILITYTABLE_SPELLTYPE] == SPELLTYPE_CROWDCONTROL) then
local spellName, _, spellIcon = GetSpellInfo(ability [ABILITYTABLE_SPELLID])
line.RightIcon:SetTexture(spellIcon)
line.RightIcon:SetTexCoord (.06, .94, .06, .94)
line.RightIcon:SetTexCoord(.06, .94, .06, .94)
local targetName = ability [ABILITYTABLE_TARGETNAME]
if (targetName) then
@@ -576,7 +576,7 @@ function Details:CreateEventTrackerFrame(parent, name)
line.RightText:SetText(targetName or "unknown target")
line.ActionIcon:SetTexture([[Interface\AddOns\Details\images\event_tracker_icons]])
line.ActionIcon:SetTexCoord (0.376, 0.5, 0, 1)
line.ActionIcon:SetTexCoord(0.376, 0.5, 0, 1)
end
+39 -39
View File
@@ -49,7 +49,7 @@ function Details:OpenForge()
f:SetFrameStrata("HIGH")
f:SetToplevel (true)
f:SetMovable(true)
f.Title:SetTextColor (1, .8, .2)
f.Title:SetTextColor(1, .8, .2)
local have_plugins_enabled
@@ -88,7 +88,7 @@ function Details:OpenForge()
tutorialFrame.Desc:SetPoint("topleft", tutorialFrame, "topleft", 10, -45)
tutorialFrame.Example:SetPoint("topleft", tutorialFrame, "topleft", 10, -110)
local editBox = Details.gump:CreateTextEntry (tutorialFrame, function()end, 375, 20, nil, nil, nil, entry_template, label_template)
local editBox = Details.gump:CreateTextEntry(tutorialFrame, function()end, 375, 20, nil, nil, nil, entry_template, label_template)
editBox:SetPoint("topleft", tutorialFrame.Example, "bottomleft", 0, -10)
editBox:SetText([[https://www.youtube.com/watch?v=om0k1Yj2pEw]])
editBox:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -167,7 +167,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_PLAYERNAME"] .. ": ")
label:SetPoint("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllPlayersNameFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeAllPlayersNameFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -182,7 +182,7 @@ function Details:OpenForge()
if (filter ~= "") then
filter = lower (filter)
local actor_name = lower (actor:name())
if (actor_name:find (filter)) then
if (actor_name:find(filter)) then
t [#t+1] = actor
end
else
@@ -231,7 +231,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_PETNAME"] .. ": ")
label:SetPoint("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllPetsNameFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeAllPetsNameFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -239,7 +239,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_OWNERNAME"] .. ": ")
label:SetPoint("left", entry.widget, "right", 20, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllPetsOwnerFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeAllPetsOwnerFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -256,14 +256,14 @@ function Details:OpenForge()
if (filter_petname ~= "") then
filter_petname = lower (filter_petname)
local actor_name = lower (actor:name())
if (not actor_name:find (filter_petname)) then
if (not actor_name:find(filter_petname)) then
can_add = false
end
end
if (filter_ownername ~= "") then
filter_ownername = lower (filter_ownername)
local actor_name = lower (actor.ownerName)
if (not actor_name:find (filter_ownername)) then
if (not actor_name:find(filter_ownername)) then
can_add = false
end
end
@@ -289,7 +289,7 @@ function Details:OpenForge()
if (data) then
return {
index,
data:name():gsub ("(<).*(>)", "") or "",
data:name():gsub("(<).*(>)", "") or "",
data.ownerName or "",
Details:GetNpcIdFromGuid (data.serial),
data.serial or "",
@@ -318,7 +318,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_ENEMYNAME"] .. ": ")
label:SetPoint("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllEnemiesNameFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeAllEnemiesNameFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -333,7 +333,7 @@ function Details:OpenForge()
if (filter ~= "") then
filter = lower (filter)
local actor_name = lower (actor:name())
if (actor_name:find (filter)) then
if (actor_name:find(filter)) then
t [#t+1] = actor
end
else
@@ -415,7 +415,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_SPELLNAME"] .. ": ")
label:SetPoint("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllSpellsNameFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeAllSpellsNameFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -423,7 +423,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_CASTERNAME"] .. ": ")
label:SetPoint("left", entry.widget, "right", 20, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeAllSpellsCasterFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeAllSpellsCasterFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -455,7 +455,7 @@ function Details:OpenForge()
className = lower (className)
end
if (not className:find (lower_FilterCaster)) then
if (not className:find(lower_FilterCaster)) then
can_add = false
else
className = classNameOriginal
@@ -467,7 +467,7 @@ function Details:OpenForge()
local spellName = GetSpellInfo(spellID)
if (spellName) then
spellName = lower (spellName)
if (not spellName:find (lower_FilterSpellName)) then
if (not spellName:find(lower_FilterSpellName)) then
can_add = false
end
else
@@ -504,7 +504,7 @@ function Details:OpenForge()
local events = ""
if (EncounterSpellEvents and EncounterSpellEvents [data[1]]) then
for token, _ in pairs(EncounterSpellEvents [data[1]].token) do
token = token:gsub ("SPELL_", "")
token = token:gsub("SPELL_", "")
events = events .. token .. ", "
end
events = events:sub (1, #events - 3)
@@ -545,7 +545,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_SPELLNAME"] .. ": ")
label:SetPoint("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeEncounterSpellsNameFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeEncounterSpellsNameFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -553,7 +553,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_CASTERNAME"] .. ": ")
label:SetPoint("left", entry.widget, "right", 20, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeEncounterSpellsCasterFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeEncounterSpellsCasterFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -561,7 +561,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ")
label:SetPoint("left", entry.widget, "right", 20, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeEncounterSpellsEncounterFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeEncounterSpellsEncounterFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -592,7 +592,7 @@ function Details:OpenForge()
local can_add = true
if (lower_FilterCaster ~= "") then
if (not lower (enemyName):find (lower_FilterCaster)) then
if (not lower (enemyName):find(lower_FilterCaster)) then
can_add = false
end
end
@@ -602,7 +602,7 @@ function Details:OpenForge()
local spellName = GetSpellInfo(spellID)
if (spellName) then
spellName = lower (spellName)
if (not spellName:find (lower_FilterSpellName)) then
if (not spellName:find(lower_FilterSpellName)) then
can_add = false
end
else
@@ -615,7 +615,7 @@ function Details:OpenForge()
local encounterName = bossDetails.boss
if (filter_encounter ~= "" and encounterName and encounterName ~= "") then
encounterName = lower (encounterName)
if (not encounterName:find (lower_FilterEncounterName)) then
if (not encounterName:find(lower_FilterEncounterName)) then
can_add = false
end
end
@@ -651,7 +651,7 @@ function Details:OpenForge()
local events = ""
if (EncounterSpellEvents and EncounterSpellEvents [data[1]]) then
for token, _ in pairs(EncounterSpellEvents [data[1]].token) do
token = token:gsub ("SPELL_", "")
token = token:gsub("SPELL_", "")
events = events .. token .. ", "
end
events = events:sub (1, #events - 3)
@@ -776,8 +776,8 @@ function Details:OpenForge()
spellname, _, spellicon = GetSpellInfo(data [7])
else
if (data [7]) then
local spellid = data[7]:gsub ("ej", "")
spellid = tonumber (spellid)
local spellid = data[7]:gsub("ej", "")
spellid = tonumber(spellid)
local title, description, depth, abilityIcon, displayInfo, siblingID, nextSectionID, filteredByDifficulty, link, startsOpen, flag1, flag2, flag3, flag4 = DetailsFramework.EncounterJournal.EJ_GetSectionInfo (spellid)
spellname, spellicon = title, abilityIcon
else
@@ -800,7 +800,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_BARTEXT"] .. ": ")
label:SetPoint("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeDBMBarsTextFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeDBMBarsTextFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -808,7 +808,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ")
label:SetPoint("left", entry.widget, "right", 20, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeDBMBarsEncounterFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeDBMBarsEncounterFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -828,7 +828,7 @@ function Details:OpenForge()
for key, timer in pairs(source) do
local can_add = true
if (lower_FilterBarName ~= "") then
if (not lower (timer [3]):find (lower_FilterBarName)) then
if (not lower (timer [3]):find(lower_FilterBarName)) then
can_add = false
end
end
@@ -837,7 +837,7 @@ function Details:OpenForge()
local encounterName = bossDetails and bossDetails.boss
if (encounterName and encounterName ~= "") then
encounterName = lower (encounterName)
if (not encounterName:find (lower_FilterEncounterName)) then
if (not encounterName:find(lower_FilterEncounterName)) then
can_add = false
end
end
@@ -870,7 +870,7 @@ function Details:OpenForge()
local bossDetails, bossIndex = Details:GetBossEncounterDetailsFromEncounterId (nil, data.id)
local bossName = bossDetails and bossDetails.boss or "--x--x--"
local abilityID = tonumber (data [7])
local abilityID = tonumber(data [7])
local spellName, _, spellIcon
if (abilityID) then
if (abilityID > 0) then
@@ -885,7 +885,7 @@ function Details:OpenForge()
data[2] or "",
data[7] or "",
data[4] or "0",
tostring (encounter_id) or "0",
tostring(encounter_id) or "0",
bossName,
}
else
@@ -902,7 +902,7 @@ function Details:OpenForge()
local data = all_modules [5].data [row]
local spellname, spellicon, _
local spellid = tonumber (data [2])
local spellid = tonumber(data [2])
if (type(spellid) == "number") then
if (spellid < 0) then
@@ -931,7 +931,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_BARTEXT"] .. ": ")
label:SetPoint("left", w, "left", 5, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeBigWigsBarsTextFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeBigWigsBarsTextFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -939,7 +939,7 @@ function Details:OpenForge()
local label = w:CreateFontString(nil, "overlay", "GameFontHighlightSmall")
label:SetText(L["STRING_FORGE_FILTER_ENCOUNTERNAME"] .. ": ")
label:SetPoint("left", entry.widget, "right", 20, 0)
local entry = fw:CreateTextEntry (w, nil, 120, 20, "entry", "DetailsForgeBWBarsEncounterFilter")
local entry = fw:CreateTextEntry(w, nil, 120, 20, "entry", "DetailsForgeBWBarsEncounterFilter")
entry:SetHook("OnTextChanged", function() f:refresh() end)
entry:SetPoint("left", label, "right", 2, 0)
entry:SetTemplate(Details.gump:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
@@ -961,7 +961,7 @@ function Details:OpenForge()
for key, timer in pairs(source) do
local can_add = true
if (lower_FilterBarName ~= "") then
if (not lower (timer [3]):find (lower_FilterBarName)) then
if (not lower (timer [3]):find(lower_FilterBarName)) then
can_add = false
end
end
@@ -970,7 +970,7 @@ function Details:OpenForge()
local encounterName = bossDetails and bossDetails.boss
if (encounterName and encounterName ~= "") then
encounterName = lower (encounterName)
if (not encounterName:find (lower_FilterEncounterName)) then
if (not encounterName:find(lower_FilterEncounterName)) then
can_add = false
end
end
@@ -1001,7 +1001,7 @@ function Details:OpenForge()
local bossDetails, bossIndex = Details:GetBossEncounterDetailsFromEncounterId (nil, data.id)
local bossName = bossDetails and bossDetails.boss or "--x--x--"
local abilityID = tonumber (data[2])
local abilityID = tonumber(data[2])
local spellName, _, spellIcon
if (abilityID) then
if (abilityID > 0) then
@@ -1015,7 +1015,7 @@ function Details:OpenForge()
{text = data[3] or "", id = abilityID and abilityID > 0 and abilityID or 0},
data[2] or "",
data[4] or "",
tostring (encounter_id) or "0",
tostring(encounter_id) or "0",
bossName
}
else
@@ -1058,7 +1058,7 @@ function Details:OpenForge()
local background = fillpanel:CreateTexture(nil, "background")
background:SetAllPoints()
background:SetColorTexture (0, 0, 0, 0.2)
background:SetColorTexture(0, 0, 0, 0.2)
module.fill_panel = fillpanel
end
+3 -3
View File
@@ -102,15 +102,15 @@ function Details.OpenMacrosWindow()
descLabel.textsize = 12
local options_dropdown_template = DF:GetTemplate("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
options_dropdown_template = DF.table.copy ({}, options_dropdown_template)
options_dropdown_template = DF.table.copy({}, options_dropdown_template)
options_dropdown_template.backdropcolor = {.51, .51, .51, .3}
options_dropdown_template.onenterbordercolor = {.51, .51, .51, .2}
local textEntry = DF:CreateTextEntry (line, function()end, scrollbox_size[1] - 10, 40, "MacroTextEntry", _, _, options_dropdown_template)
local textEntry = DF:CreateTextEntry(line, function()end, scrollbox_size[1] - 10, 40, "MacroTextEntry", _, _, options_dropdown_template)
textEntry:SetHook("OnEditFocusGained", textEntryOnFocusGained)
textEntry:SetHook("OnEditFocusLost", textEntryOnFocusLost)
textEntry:SetJustifyH("left")
textEntry:SetTextInsets (8, 8, 0, 0)
textEntry:SetTextInsets(8, 8, 0, 0)
titleLabel:SetPoint("topleft", line, "topleft", 5, -5)
descLabel:SetPoint("topleft", titleLabel, "bottomleft", 0, -2)
+13 -13
View File
@@ -1973,7 +1973,7 @@ local lineScript_Onmouseup = function(self, button)
if (custom and custom.on_shift_click) then
local func = loadstring (custom.on_shift_click)
if (func) then
local successful, errortext = pcall (func, self, self.minha_tabela, self._instance)
local successful, errortext = pcall(func, self, self.minha_tabela, self._instance)
if (not successful) then
Details:Msg("error occurred custom script shift+click:", errortext)
end
@@ -2519,7 +2519,7 @@ function Details:ReportSingleLine (instancia, barra)
local GameCooltip = GameCooltip
if (GameCooltipFrame1:IsShown()) then
local actor_name = barra.lineText1:GetText() or ""
actor_name = actor_name:gsub ((".*%."), "")
actor_name = actor_name:gsub((".*%."), "")
if (instancia.segmento == -1) then --overall
reportar = {"Details!: " .. Loc["STRING_OVERALL"] .. " " .. instancia.customName .. ": " .. actor_name .. " " .. Loc["STRING_CUSTOM_REPORT"]}
@@ -3081,7 +3081,7 @@ end
local alert_on_click = function(self, button)
if (self.func) then
local okey, errortext = pcall (self.func, unpack(self.func_param))
local okey, errortext = pcall(self.func, unpack(self.func_param))
if (not okey) then
Details:Msg("error on alert function:", errortext)
end
@@ -5687,7 +5687,7 @@ function Details:ToolbarMenuSetButtons(_mode, _segment, _attributes, _report, _r
self.menu_icons[5] = _reset
self.menu_icons[6] = _close
table.wipe (tbuttons)
table.wipe(tbuttons)
tbuttons[1] = self.baseframe.cabecalho.modo_selecao
tbuttons[2] = self.baseframe.cabecalho.segmento
@@ -6748,7 +6748,7 @@ local buildSegmentTooltip = function(self, deltaTime)
local thisCombat = Details.tabela_vigente
local encounter_name = thisCombat.is_boss.encounter
local instanceID = thisCombat.is_boss.ej_instance_id
instanceID = tonumber (instanceID)
instanceID = tonumber(instanceID)
if (encounter_name and instanceID and instanceID ~= 0) then
local index, name, description, encounterID, rootSectionID, link = Details:GetEncounterInfoFromEncounterName (instanceID, encounter_name)
if (index and name and encounterID) then
@@ -6950,11 +6950,11 @@ end
function Details:SetUserCustomSkinFile (file)
if (type(file) ~= "string") then
error ("SetUserCustomSkinFile() file must be a string.")
error("SetUserCustomSkinFile() file must be a string.")
end
if (file:find ("\\") or file:find ("/")) then
error ("SetUserCustomSkinFile() file must be only the file name (with out up folders) and slashes.")
if (file:find("\\") or file:find("/")) then
error("SetUserCustomSkinFile() file must be only the file name (with out up folders) and slashes.")
end
self.skin_custom = file
@@ -7287,7 +7287,7 @@ function Details:ChangeSkin(skin_name)
local callbackFunc = this_skin.callback
if (callbackFunc) then
DetailsFramework:SetEnvironment(callbackFunc)
local okey, result = pcall (callbackFunc, this_skin, self, just_updating)
local okey, result = pcall(callbackFunc, this_skin, self, just_updating)
if (not okey) then
Details:Msg("|cFFFF9900error on skin callback function|r:", result)
end
@@ -7297,7 +7297,7 @@ function Details:ChangeSkin(skin_name)
local onStartScript = this_skin.control_script_on_start
if (onStartScript) then
DetailsFramework:SetEnvironment(onStartScript)
local okey, result = pcall (onStartScript, this_skin, self)
local okey, result = pcall(onStartScript, this_skin, self)
if (not okey) then
Details:Msg("|cFFFF9900error on skin control on start function|r:", result)
end
@@ -8038,7 +8038,7 @@ function Details:AttributeMenu (enabled, pos_x, pos_y, font, size, color, side,
end
--protection against failed clean up framework table
if (self.menu_attribute_string and not getmetatable (self.menu_attribute_string)) then
if (self.menu_attribute_string and not getmetatable(self.menu_attribute_string)) then
self.menu_attribute_string = nil
end
@@ -8549,7 +8549,7 @@ function Details:StretchButtonAnchor (side)
side = self.stretch_button_side
end
if (side == 1 or string.lower (side) == "top") then
if (side == 1 or string.lower(side) == "top") then
self.baseframe.button_stretch:ClearAllPoints()
local y = 0
@@ -8562,7 +8562,7 @@ function Details:StretchButtonAnchor (side)
self.baseframe.button_stretch.texture:SetTexCoord(unpack(COORDS_STRETCH))
self.stretch_button_side = 1
elseif (side == 2 or string.lower (side) == "bottom") then
elseif (side == 2 or string.lower(side) == "bottom") then
self.baseframe.button_stretch:ClearAllPoints()
local y = 0
+50 -50
View File
@@ -755,7 +755,7 @@ do
local buildSkinMenu = function()
local skinOptions = {}
for skin_name, skin_table in pairs(_detalhes.skins) do
local file = skin_table.file:gsub ([[Interface\AddOns\Details\images\skins\]], "")
local file = skin_table.file:gsub([[Interface\AddOns\Details\images\skins\]], "")
local desc = "Author: |cFFFFFFFF" .. skin_table.author .. "|r\nVersion: |cFFFFFFFF" .. skin_table.version .. "|r\nSite: |cFFFFFFFF" .. skin_table.site .. "|r\n\nDesc: |cFFFFFFFF" .. skin_table.desc .. "|r\n\nFile: |cFFFFFFFF" .. file .. ".tga|r"
skinOptions [#skinOptions+1] = {value = skin_name, label = skin_name, onclick = onSelectSkin, icon = "Interface\\GossipFrame\\TabardGossipIcon", desc = desc}
end
@@ -1044,7 +1044,7 @@ do
{--chat tab width offset
type = "range",
get = function() return tonumber (_detalhes.chat_tab_embed.x_offset) end,
get = function() return tonumber(_detalhes.chat_tab_embed.x_offset) end,
set = function(self, fixedparam, value)
_detalhes.chat_tab_embed.x_offset = value
if (_detalhes.chat_embed.enabled) then
@@ -1061,7 +1061,7 @@ do
{--chat tab height offset
type = "range",
get = function() return tonumber (_detalhes.chat_tab_embed.y_offset) end,
get = function() return tonumber(_detalhes.chat_tab_embed.y_offset) end,
set = function(self, fixedparam, value)
_detalhes.chat_tab_embed.y_offset = value
if (_detalhes.chat_embed.enabled) then
@@ -1220,7 +1220,7 @@ do
local sectionOptions = {
{--line height
type = "range",
get = function() return tonumber (currentInstance.row_info.height) end,
get = function() return tonumber(currentInstance.row_info.height) end,
set = function(self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarSettings", value)
afterUpdate()
@@ -1234,7 +1234,7 @@ do
{--padding
type = "range",
get = function() return tonumber (currentInstance.row_info.space.between) end,
get = function() return tonumber(currentInstance.row_info.space.between) end,
set = function(self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value)
afterUpdate()
@@ -1470,7 +1470,7 @@ do
return default
end,
func = function(self, _, text)
if (text:find ("spec_")) then
if (text:find("spec_")) then
editInstanceSetting(currentInstance, "SetBarSpecIconSettings", true, text, true)
else
if (currentInstance.row_info.use_spec_icons) then
@@ -1499,7 +1499,7 @@ do
{--icon size offset
type = "range",
get = function() return tonumber (currentInstance.row_info.icon_size_offset) end,
get = function() return tonumber(currentInstance.row_info.icon_size_offset) end,
set = function(self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarSettings", nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, value)
afterUpdate()
@@ -1528,7 +1528,7 @@ do
{--faction icon size offset
type = "range",
get = function() return tonumber (currentInstance.row_info.faction_icon_size_offset) end,
get = function() return tonumber(currentInstance.row_info.faction_icon_size_offset) end,
set = function(self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarFactionIconSettings", nil, value)
afterUpdate()
@@ -1557,7 +1557,7 @@ do
{--role icon size offset
type = "range",
get = function() return tonumber (currentInstance.row_info.arena_role_icon_size_offset) end,
get = function() return tonumber(currentInstance.row_info.arena_role_icon_size_offset) end,
set = function(self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarArenaRoleIconSettings", nil, value)
afterUpdate()
@@ -1621,7 +1621,7 @@ do
{--lineText2 (left, usuali is the 'done' amount)
type = "range",
get = function() return tonumber (currentInstance.fontstrings_text2_anchor) end,
get = function() return tonumber(currentInstance.fontstrings_text2_anchor) end,
set = function(self, fixedparam, value)
editInstanceSetting(currentInstance, "fontstrings_text2_anchor", value)
editInstanceSetting(currentInstance, "InstanceRefreshRows")
@@ -1636,7 +1636,7 @@ do
{--lineText3 (in the middle)
type = "range",
get = function() return tonumber (currentInstance.fontstrings_text3_anchor) end,
get = function() return tonumber(currentInstance.fontstrings_text3_anchor) end,
set = function(self, fixedparam, value)
editInstanceSetting(currentInstance, "fontstrings_text3_anchor", value)
editInstanceSetting(currentInstance, "InstanceRefreshRows")
@@ -1651,7 +1651,7 @@ do
{--lineText4 (closest to the right)
type = "range",
get = function() return tonumber (currentInstance.fontstrings_text4_anchor) end,
get = function() return tonumber(currentInstance.fontstrings_text4_anchor) end,
set = function(self, fixedparam, value)
editInstanceSetting(currentInstance, "fontstrings_text4_anchor", value)
editInstanceSetting(currentInstance, "InstanceRefreshRows")
@@ -1766,7 +1766,7 @@ do
{--border size
type = "range",
get = function() return tonumber (currentInstance.row_info.backdrop.size) end,
get = function() return tonumber(currentInstance.row_info.backdrop.size) end,
set = function(self, fixedparam, value)
editInstanceSetting(currentInstance, "SetBarBackdropSettings", nil, value)
afterUpdate()
@@ -3520,7 +3520,7 @@ do
bframe.plugin = pluginObject
bframe.id = i
DF:NewImage (bframe, pluginObject.__icon, 18, 18, nil, nil, "toolbarPluginsIcon"..i, "$parentToolbarPluginsIcon"..i)
DF:NewImage(bframe, pluginObject.__icon, 18, 18, nil, nil, "toolbarPluginsIcon"..i, "$parentToolbarPluginsIcon"..i)
bframe ["toolbarPluginsIcon"..i]:SetPoint("topleft", anchorFrame, "topleft", 10, y)
DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel"..i, "toolbarPluginsLabel"..i, pluginObject.__name)
@@ -3552,7 +3552,7 @@ do
if (pluginObject.OpenOptionsPanel) then
DF:NewButton(bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 120, 20, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template)
bframe ["OptionsButton"..i]:SetPoint("topleft", anchorFrame, "topleft", 510, y-0)
bframe ["OptionsButton"..i]:SetTextColor (button_color_rgb)
bframe ["OptionsButton"..i]:SetTextColor(button_color_rgb)
bframe ["OptionsButton"..i]:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3)
end
@@ -3590,7 +3590,7 @@ do
bframe.id = i
bframe.hasDesc = allExistentToolbarPlugins [o] [4]
DF:NewImage (bframe, pluginObject.__icon, 18, 18, nil, nil, "toolbarPluginsIcon"..i, "$parentToolbarPluginsIcon"..i)
DF:NewImage(bframe, pluginObject.__icon, 18, 18, nil, nil, "toolbarPluginsIcon"..i, "$parentToolbarPluginsIcon"..i)
bframe ["toolbarPluginsIcon"..i]:SetPoint("topleft", anchorFrame, "topleft", 10, y)
DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel"..i, "toolbarPluginsLabel"..i, pluginObject.__name)
@@ -3655,7 +3655,7 @@ do
bframe.plugin = pluginObject
bframe.id = i
DF:NewImage (bframe, pluginObject.__icon, 18, 18, nil, nil, "raidPluginsIcon"..i, "$parentRaidPluginsIcon"..i)
DF:NewImage(bframe, pluginObject.__icon, 18, 18, nil, nil, "raidPluginsIcon"..i, "$parentRaidPluginsIcon"..i)
bframe ["raidPluginsIcon"..i]:SetPoint("topleft", anchorFrame, "topleft", 10, y)
DF:NewLabel(bframe, _, "$parentRaidPluginsLabel"..i, "raidPluginsLabel"..i, pluginObject.__name)
@@ -3693,7 +3693,7 @@ do
if (pluginObject.OpenOptionsPanel) then
DF:NewButton(bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 18, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template)
bframe ["OptionsButton"..i]:SetPoint("topleft", anchorFrame, "topleft", 510, y-0)
bframe ["OptionsButton"..i]:SetTextColor (button_color_rgb)
bframe ["OptionsButton"..i]:SetTextColor(button_color_rgb)
bframe ["OptionsButton"..i]:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3)
end
@@ -3728,7 +3728,7 @@ do
bframe.id = i
bframe.hasDesc = allExistentRaidPlugins [o] [4]
DF:NewImage (bframe, pluginObject.__icon, 18, 18, nil, nil, "toolbarPluginsIcon"..i, "$parentToolbarPluginsIcon"..i)
DF:NewImage(bframe, pluginObject.__icon, 18, 18, nil, nil, "toolbarPluginsIcon"..i, "$parentToolbarPluginsIcon"..i)
bframe ["toolbarPluginsIcon"..i]:SetPoint("topleft", anchorFrame, "topleft", 10, y)
DF:NewLabel(bframe, _, "$parentToolbarPluginsLabel"..i, "toolbarPluginsLabel"..i, pluginObject.__name)
@@ -3793,7 +3793,7 @@ do
bframe.plugin = pluginObject
bframe.id = i
DF:NewImage (bframe, pluginObject.__icon, 18, 18, nil, nil, "soloPluginsIcon"..i, "$parentSoloPluginsIcon"..i)
DF:NewImage(bframe, pluginObject.__icon, 18, 18, nil, nil, "soloPluginsIcon"..i, "$parentSoloPluginsIcon"..i)
bframe ["soloPluginsIcon"..i]:SetPoint("topleft", anchorFrame, "topleft", 10, y)
DF:NewLabel(bframe, _, "$parentSoloPluginsLabel"..i, "soloPluginsLabel"..i, pluginObject.__name)
@@ -3827,7 +3827,7 @@ do
if (pluginObject.OpenOptionsPanel) then
DF:NewButton(bframe, nil, "$parentOptionsButton"..i, "OptionsButton"..i, 86, 18, pluginObject.OpenOptionsPanel, nil, nil, nil, Loc ["STRING_OPTIONS_PLUGINS_OPTIONS"], nil, options_button_template)
bframe ["OptionsButton"..i]:SetPoint("topleft", anchorFrame, "topleft", 510, y-0)
bframe ["OptionsButton"..i]:SetTextColor (button_color_rgb)
bframe ["OptionsButton"..i]:SetTextColor(button_color_rgb)
bframe ["OptionsButton"..i]:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3)
end
@@ -4632,7 +4632,7 @@ do
local textureOptions = sectionFrame.wallpaperOptions
local selectedTextureOption = texturePath
if (texturePath:find ("TALENTFRAME")) then
if (texturePath:find("TALENTFRAME")) then
editInstanceSetting(currentInstance, "InstanceWallpaper", texturePath, nil, nil, {0, 1, 0, 0.703125}, nil, nil, {1, 1, 1, 1})
afterUpdate()
@@ -4724,7 +4724,7 @@ do
local previewX, previewY = 460, -60
local preview = sectionFrame:CreateTexture(nil, "overlay")
preview:SetDrawLayer ("artwork", 3)
preview:SetDrawLayer("artwork", 3)
preview:SetSize(256, 128)
preview:SetPoint("topleft", sectionFrame, "topleft", previewX, previewY)
@@ -4736,29 +4736,29 @@ do
whiteBackground:SetColorTexture(1, 1, 1, 1)
--background grid
local icon1 = DF:NewImage (sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon1")
local icon1 = DF:NewImage(sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon1")
icon1:SetTexture("Interface\\AddOns\\Details\\images\\icons")
icon1:SetPoint("topleft", sectionFrame, "topleft", previewX, previewY)
icon1:SetDrawLayer ("artwork", 1)
icon1:SetTexCoord (0.337890625, 0.5859375, 0.59375, 0.716796875-0.0009765625) --173 304 300 367
icon1:SetDrawLayer("artwork", 1)
icon1:SetTexCoord(0.337890625, 0.5859375, 0.59375, 0.716796875-0.0009765625) --173 304 300 367
local icon2 = DF:NewImage (sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon2")
local icon2 = DF:NewImage(sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon2")
icon2:SetTexture("Interface\\AddOns\\Details\\images\\icons")
icon2:SetPoint("left", icon1.widget, "right", -1, 0)
icon2:SetDrawLayer ("artwork", 1)
icon2:SetTexCoord (0.337890625, 0.5859375, 0.59375, 0.716796875-0.0009765625) --173 304 300 367
icon2:SetDrawLayer("artwork", 1)
icon2:SetTexCoord(0.337890625, 0.5859375, 0.59375, 0.716796875-0.0009765625) --173 304 300 367
local icon3 = DF:NewImage (sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon3")
local icon3 = DF:NewImage(sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon3")
icon3:SetTexture("Interface\\AddOns\\Details\\images\\icons")
icon3:SetPoint("top", icon1.widget, "bottom")
icon3:SetDrawLayer ("artwork", 1)
icon3:SetTexCoord (0.337890625, 0.5859375, 0.59375+0.0009765625, 0.716796875) --173 304 300 367
icon3:SetDrawLayer("artwork", 1)
icon3:SetTexCoord(0.337890625, 0.5859375, 0.59375+0.0009765625, 0.716796875) --173 304 300 367
local icon4 = DF:NewImage (sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon4")
local icon4 = DF:NewImage(sectionFrame, nil, 128, 64, "artwork", nil, nil, "$parentIcon4")
icon4:SetTexture("Interface\\AddOns\\Details\\images\\icons")
icon4:SetPoint("left", icon3.widget, "right", -1, 0)
icon4:SetDrawLayer ("artwork", 1)
icon4:SetTexCoord (0.337890625, 0.5859375, 0.59375+0.0009765625, 0.716796875) --173 304 300 367
icon4:SetDrawLayer("artwork", 1)
icon4:SetTexCoord(0.337890625, 0.5859375, 0.59375+0.0009765625, 0.716796875) --173 304 300 367
icon1:SetVertexColor(.15, .15, .15, 1)
icon2:SetVertexColor(.15, .15, .15, 1)
@@ -4771,33 +4771,33 @@ do
local L1 = sectionFrame:CreateTexture(nil, "overlay")
L1:SetPoint("topleft", preview, "topleft")
L1:SetTexture("Interface\\AddOns\\Details\\images\\icons")
L1:SetTexCoord (0.13671875+0.0009765625, 0.234375, 0.29296875, 0.1953125+0.0009765625)
L1:SetTexCoord(0.13671875+0.0009765625, 0.234375, 0.29296875, 0.1953125+0.0009765625)
L1:SetSize(w, h)
L1:SetDrawLayer ("overlay", 2)
L1:SetDrawLayer("overlay", 2)
L1:SetVertexColor(1, 1, 1, .8)
local L2 = sectionFrame:CreateTexture(nil, "overlay")
L2:SetPoint("bottomleft", preview, "bottomleft")
L2:SetTexture("Interface\\AddOns\\Details\\images\\icons")
L2:SetTexCoord (0.13671875+0.0009765625, 0.234375, 0.1953125+0.0009765625, 0.29296875)
L2:SetTexCoord(0.13671875+0.0009765625, 0.234375, 0.1953125+0.0009765625, 0.29296875)
L2:SetSize(w, h)
L2:SetDrawLayer ("overlay", 2)
L2:SetDrawLayer("overlay", 2)
L2:SetVertexColor(1, 1, 1, .8)
local L3 = sectionFrame:CreateTexture(nil, "overlay")
L3:SetPoint("bottomright", preview, "bottomright", 0, 0)
L3:SetTexture("Interface\\AddOns\\Details\\images\\icons")
L3:SetTexCoord (0.234375, 0.13671875-0.0009765625, 0.1953125+0.0009765625, 0.29296875)
L3:SetTexCoord(0.234375, 0.13671875-0.0009765625, 0.1953125+0.0009765625, 0.29296875)
L3:SetSize(w, h)
L3:SetDrawLayer ("overlay", 5)
L3:SetDrawLayer("overlay", 5)
L3:SetVertexColor(1, 1, 1, .8)
local L4 = sectionFrame:CreateTexture(nil, "overlay")
L4:SetPoint("topright", preview, "topright", 0, 0)
L4:SetTexture("Interface\\AddOns\\Details\\images\\icons")
L4:SetTexCoord (0.234375, 0.13671875-0.0009765625, 0.29296875, 0.1953125+0.0009765625)
L4:SetTexCoord(0.234375, 0.13671875-0.0009765625, 0.29296875, 0.1953125+0.0009765625)
L4:SetSize(w, h)
L4:SetDrawLayer ("overlay", 5)
L4:SetDrawLayer("overlay", 5)
L4:SetVertexColor(1, 1, 1, .8)
--update preview
@@ -4805,7 +4805,7 @@ do
local wallpaper = currentInstance.wallpaper
preview:SetTexture(wallpaper.texture)
preview:SetTexCoord (unpack(wallpaper.texcoord))
preview:SetTexCoord(unpack(wallpaper.texcoord))
preview:SetVertexColor(unpack(wallpaper.overlay))
preview:SetAlpha(wallpaper.alpha)
end
@@ -4841,7 +4841,7 @@ do
local wallpaper = currentInstance.wallpaper
if (wallpaper.texture:find ("TALENTFRAME")) then
if (wallpaper.texture:find("TALENTFRAME")) then
if (wallpaper.anchor == "all") then
DF:ImageEditor (callmeback, wallpaper.texture, wallpaper.texcoord, wallpaper.overlay, currentInstance.baseframe.wallpaper:GetWidth(), currentInstance.baseframe.wallpaper:GetHeight(), nil, wallpaper.alpha, true)
else
@@ -6305,7 +6305,7 @@ do
addframe.spellIconButton.icon.texture = texture
end
local icon_button = DF:NewButton(addframe, nil, "$parentSpellIconButton", "spellIconButton", 20, 20, function() DF:IconPick (icon_button_func, true) end)
local icon_button_icon = DF:NewImage (icon_button, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentSpellIcon")
local icon_button_icon = DF:NewImage(icon_button, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentSpellIcon")
icon_button_icon:SetPoint(0, 0)
icon_button:InstallCustomTexture()
icon_button:SetPoint("left", spellicon, "right", 2, 0)
@@ -6325,7 +6325,7 @@ do
end
local icon = addframe.spellIconButton.icon.texture
id = tonumber (id)
id = tonumber(id)
if (not id) then
return _detalhes:Msg(Loc ["STRING_OPTIONS_SPELL_IDERROR"])
end
@@ -6404,7 +6404,7 @@ do
--warning
if (not _detalhes:GetPlugin ("DETAILS_PLUGIN_CHART_VIEWER")) then
local label = DF:NewLabel(sectionFrame, _, "$parentPluginWarningLabel", "PluginWarningLabel", Loc ["STRING_OPTIONS_CHART_PLUGINWARNING"], "GameFontNormal")
local image = DF:NewImage (sectionFrame, [[Interface\DialogFrame\UI-Dialog-Icon-AlertNew]])
local image = DF:NewImage(sectionFrame, [[Interface\DialogFrame\UI-Dialog-Icon-AlertNew]])
label:SetPoint("topright", sectionFrame, "topright", -42, -10)
label:SetJustifyH("left")
label:SetWidth(160)
@@ -6517,7 +6517,7 @@ do
big_code_editor2:Show()
big_code_editor2.editbox:HighlightText()
big_code_editor2.editbox:SetFocus (true)
big_code_editor2.editbox:SetFocus(true)
else
Details:Msg("error exporting the time capture.") --localize-me
end
@@ -6716,7 +6716,7 @@ do
local import = function()
importframe:Show()
importframe:SetText("")
importframe:SetFocus (true)
importframe:SetFocus(true)
addframe:Hide()
big_code_editor:ClearFocus()
big_code_editor:Hide()
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -257,7 +257,7 @@
if (playerObject:IsPlayer()) then
local unitClassID = classIds [playerObject:Class()] or 13
local unitName = playerObject:Name()
local playerPosition = (((unitClassID or 0) + 128) ^ 4) + tonumber (string.byte(unitName, 1) .. "" .. string.byte(unitName, 2))
local playerPosition = (((unitClassID or 0) + 128) ^ 4) + tonumber(string.byte(unitName, 1) .. "" .. string.byte(unitName, 2))
tinsert(playerTable, {playerObject, playerPosition, playerObject.total})
end
end
+2 -2
View File
@@ -766,12 +766,12 @@ local createDropdown = function(thisFrame)
window.recently_report_buttons = {}
local historyBlockBackground = window:CreateTexture(nil, "background")
historyBlockBackground:SetColorTexture (0, 0, 0, .3)
historyBlockBackground:SetColorTexture(0, 0, 0, .3)
historyBlockBackground:SetSize(160, 158)
historyBlockBackground:SetPoint("topleft", window, "topleft", 3, -25)
local separator = window:CreateTexture(nil, "border")
separator:SetColorTexture (0, 0, 0, .6)
separator:SetColorTexture(0, 0, 0, .6)
separator:SetSize(2, 158)
separator:SetPoint("topleft", historyBlockBackground, "topright", 0, 0)
+1 -1
View File
@@ -22,7 +22,7 @@ function panel:Open (text, callback, host, default)
panel:SetPoint("center", host, "center")
end
text = text:gsub ("||", "|")
text = text:gsub("||", "|")
panel.default_text = text
panel.editbox:SetText(text)
panel.callback = callback
+5 -5
View File
@@ -51,7 +51,7 @@ function Details.OpenRunCodeWindow()
code_editor:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
code_editor:SetBackdropBorderColor(0, 0, 0, 1)
code_editor.__background:SetColorTexture (0.2317647, 0.2317647, 0.2317647)
code_editor.__background:SetColorTexture(0.2317647, 0.2317647, 0.2317647)
code_editor.__background:SetVertexColor(0.27, 0.27, 0.27)
code_editor.__background:SetAlpha(0.8)
code_editor.__background:SetVertTile(true)
@@ -82,10 +82,10 @@ function Details.OpenRunCodeWindow()
local func, errortext = loadstring (script, "Q")
if (not func) then
local firstLine = strsplit("\n", script, 2)
errortext = errortext:gsub (firstLine, "")
errortext = errortext:gsub ("%[string \"", "")
errortext = errortext:gsub ("...\"]:", "")
errortext = errortext:gsub ("Q\"]:", "")
errortext = errortext:gsub(firstLine, "")
errortext = errortext:gsub("%[string \"", "")
errortext = errortext:gsub("...\"]:", "")
errortext = errortext:gsub("Q\"]:", "")
errortext = "Line " .. errortext
errortext_label.text = errortext
else
+9 -9
View File
@@ -239,7 +239,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild
f.DownloadedSize = f.DownloadedSize + length
local downloadSpeed = f.DownloadedSize / (time() - f.SyncStartTime)
f.SyncText:SetText("working [downloading " .. f.DownloadedAmount .. "/" .. f.RequestedAmount .. ", " .. format ("%.2f", downloadSpeed/1024) .. "Kbps]")
f.SyncText:SetText("working [downloading " .. f.DownloadedAmount .. "/" .. f.RequestedAmount .. ", " .. format("%.2f", downloadSpeed/1024) .. "Kbps]")
end
end
end
@@ -273,9 +273,9 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild
for i = 1, AmtLines do
if (f.LatestResourceTable[i]) then
local playerName = f.LatestResourceTable[i][1]
playerName = playerName:gsub ("%|c%x%x%x%x%x%x%x%x", "")
playerName = playerName:gsub ("%|r", "")
playerName = playerName:gsub (".*%s", "")
playerName = playerName:gsub("%|c%x%x%x%x%x%x%x%x", "")
playerName = playerName:gsub("%|r", "")
playerName = playerName:gsub(".*%s", "")
tinsert(result, {playerName, f.LatestResourceTable[i][2]})
else
break
@@ -290,7 +290,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild
end
end
local ReportButton = DF:CreateButton(f, f.BuildReport, 130, 20, Loc ["STRING_OPTIONS_REPORT_ANCHOR"]:gsub (":", ""), nil, nil, nil, "ReportButton", nil, nil, options_button_template, options_text_template)
local ReportButton = DF:CreateButton(f, f.BuildReport, 130, 20, Loc ["STRING_OPTIONS_REPORT_ANCHOR"]:gsub(":", ""), nil, nil, nil, "ReportButton", nil, nil, options_button_template, options_text_template)
ReportButton:SetPoint("right", GuildSyncButton, "left", -2, 0)
ReportButton:SetIcon ([[Interface\GLUES\CharacterSelect\RestoreButton]], 12, 12, "overlay", {0.2, .8, 0.2, .8}, nil, 4)
@@ -674,7 +674,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild
local roleTable = encounter [role]
local date = encounter.date
date = date:gsub (".*%s", "")
date = date:gsub(".*%s", "")
date = date:sub (1, -4)
local player = roleTable [playerName]
@@ -698,7 +698,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild
GameCooltip:AddLine("Total Done:", Details:ToK2 (self.data.value), 1, "white")
GameCooltip:AddLine("Dps:", Details:ToK2 (self.data.value / self.data.elapsed), 1, "white")
GameCooltip:AddLine("Item Level:", floor(self.data.data [2]), 1, "white")
GameCooltip:AddLine("Date:", self.data.fulldate:gsub (".*%s", ""), 1, "white")
GameCooltip:AddLine("Date:", self.data.fulldate:gsub(".*%s", ""), 1, "white")
GameCooltip:SetOwner(self.ball.tooltip_anchor)
GameCooltip:Show()
@@ -734,7 +734,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild
local roleTable = encounter [role]
local date = encounter.date
date = date:gsub (".*%s", "")
date = date:gsub(".*%s", "")
date = date:sub (1, -4)
for playerName, playerTable in pairs(roleTable) do
@@ -821,7 +821,7 @@ function Details:OpenRaidHistoryWindow (_raid, _boss, _difficulty, _role, _guild
local roleTable = encounter [role]
local date = encounter.date
date = date:gsub (".*%s", "")
date = date:gsub(".*%s", "")
date = date:sub (1, -4)
amt_encounters = amt_encounters + 1
+9 -9
View File
@@ -223,7 +223,7 @@ do
title_icon:SetPoint("topleft", x, y)
local texture, l, r, t, b = Details:GetAttributeIcon (attribute)
title_icon:SetTexture(texture)
title_icon:SetTexCoord (l, r, t, b)
title_icon:SetTexCoord(l, r, t, b)
title_icon:SetSize(18, 18)
local title_str = allDisplaysFrame:CreateFontString(nil, "overlay", "GameFontNormal")
title_str:SetPoint("left", title_icon, "right", 2, 0)
@@ -242,7 +242,7 @@ do
allDisplaysFrame.check_text_size (button.text)
button.texture:SetTexture(Details.sub_atributos [attribute].icones [i] [1])
button.texture:SetTexCoord (unpack(Details.sub_atributos [attribute].icones [i] [2]))
button.texture:SetTexCoord(unpack(Details.sub_atributos [attribute].icones [i] [2]))
tinsert(allDisplaysFrame.buttons [attribute], button)
y = y - 17
end
@@ -280,7 +280,7 @@ do
allDisplaysFrame.buttons[6] = {}
local title_icon = allDisplaysFrame:CreateTexture(nil, "overlay")
title_icon:SetTexture([[Interface\AddOns\Details\images\modo_icones]])
title_icon:SetTexCoord (32/256*3, 32/256*4, 0, 1)
title_icon:SetTexCoord(32/256*3, 32/256*4, 0, 1)
title_icon:SetSize(16, 16)
local title_str = allDisplaysFrame:CreateFontString(nil, "overlay", "GameFontNormal")
@@ -311,7 +311,7 @@ do
allDisplaysFrame.check_text_size (button.text)
button.texture:SetTexture(custom.icon)
button.texture:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875)
button.texture:SetTexCoord(0.078125, 0.921875, 0.078125, 0.921875)
button:Show()
button_index = button_index + 1
@@ -354,7 +354,7 @@ do
allDisplaysFrame.check_text_size(button.text)
button.texture:SetTexture(ptable[2])
button.texture:SetTexCoord (0.078125, 0.921875, 0.078125, 0.921875)
button.texture:SetTexCoord(0.078125, 0.921875, 0.078125, 0.921875)
button:Show()
button_index = button_index + 1
@@ -542,7 +542,7 @@ function Details.switch:ShowMe(instancia)
local background = button:CreateTexture(nil, "background")
background:SetTexture("Interface\\SPELLBOOK\\Spellbook-Parts")
background:SetTexCoord (0.31250000, 0.96484375, 0.37109375, 0.52343750)
background:SetTexCoord(0.31250000, 0.96484375, 0.37109375, 0.52343750)
background:SetWidth(85)
background:SetPoint("topleft", s.widget, "topleft", -16, 3)
background:SetPoint("bottomright", s.widget, "bottomright", -3, -5)
@@ -623,12 +623,12 @@ function Details.switch:ShowMe(instancia)
local block1 = Details.switch:GetSegmentBlock (1)
block1:SetText(Loc["STRING_CURRENTFIGHT"])
block1.texture:SetTexture([[Interface\Scenarios\ScenariosParts]])
block1.texture:SetTexCoord (55/512, 81/512, 368/512, 401/512)
block1.texture:SetTexCoord(55/512, 81/512, 368/512, 401/512)
local block2 = Details.switch:GetSegmentBlock (2)
block2:SetText(Loc["STRING_SEGMENT_OVERALL"])
block2.texture:SetTexture([[Interface\Scenarios\ScenariosParts]])
block2.texture:SetTexCoord (55/512, 81/512, 368/512, 401/512)
block2.texture:SetTexCoord(55/512, 81/512, 368/512, 401/512)
end
Details.switch:ClearSegmentBlocks()
@@ -648,7 +648,7 @@ function Details.switch:ShowMe(instancia)
local L, R, T, B, Texture = Details:GetBossIcon (combat.is_boss.mapid, combat.is_boss.index)
if (L) then
block.texture:SetTexture(Texture)
block.texture:SetTexCoord (L, R, T, B)
block.texture:SetTexCoord(L, R, T, B)
else
block.texture:SetTexture([[Interface\Scenarios\ScenarioIcon-Boss]])
end
+78 -78
View File
@@ -68,7 +68,7 @@ local text_dispell_prototype = {
["events"] = "COMBAT_LOG_EVENT_UNFILTERED, ENCOUNTER_START",
["use_spellName"] = false,
["use_spellId"] = false,
["custom"] = "function(event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)\n if (event == \"COMBAT_LOG_EVENT_UNFILTERED\") then\n \n if ((token == \"SPELL_DISPEL\" or token == \"SPELL_STOLEN\") and extraSpellID == 159947) then\n aura_env.dispelled = aura_env.dispelled + 1\n aura_env.dispels_by [who_name] = (aura_env.dispels_by [who_name] or 0) + 1\n \n aura_env.text = aura_env.text .. \"|cffd2e8ff\" .. who_name .. \" (\" .. aura_env.dispels_by [who_name] .. \") \".. \"|r\\n\"\n \n if (select(2, aura_env.text:gsub (\"\\n\", \"\")) == 9) then\n aura_env.text = aura_env.text:gsub (\".-\\n\", \"\", 1)\n end\n return true\n end \n else\n aura_env.text = \"\"\n aura_env.success = 0\n aura_env.dispelled = 0\n wipe (aura_env.dispels_by)\n return true \n end\nend",
["custom"] = "function(event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)\n if (event == \"COMBAT_LOG_EVENT_UNFILTERED\") then\n \n if ((token == \"SPELL_DISPEL\" or token == \"SPELL_STOLEN\") and extraSpellID == 159947) then\n aura_env.dispelled = aura_env.dispelled + 1\n aura_env.dispels_by [who_name] = (aura_env.dispels_by [who_name] or 0) + 1\n \n aura_env.text = aura_env.text .. \"|cffd2e8ff\" .. who_name .. \" (\" .. aura_env.dispels_by [who_name] .. \") \".. \"|r\\n\"\n \n if (select(2, aura_env.text:gsub(\"\\n\", \"\")) == 9) then\n aura_env.text = aura_env.text:gsub(\".-\\n\", \"\", 1)\n end\n return true\n end \n else\n aura_env.text = \"\"\n aura_env.success = 0\n aura_env.dispelled = 0\n wipe (aura_env.dispels_by)\n return true \n end\nend",
["spellIds"] = {
},
["use_message"] = true,
@@ -827,7 +827,7 @@ local text_dbm_timerbar_prototype = {
["fontSize"] = 60,
["color"] = {0.8, 1, 0.8, 1},
["displayText"] = "%c\n",
["customText"] = "function()\n local at = aura_env.untrigger_at\n if (at) then\n return \"\" .. aura_env.ability_text .. \"\\n==> \" .. format (\"%.1f\", at - GetTime()) .. \" <==\"\n else\n return \"\"\n end \n \nend\n",
["customText"] = "function()\n local at = aura_env.untrigger_at\n if (at) then\n return \"\" .. aura_env.ability_text .. \"\\n==> \" .. format(\"%.1f\", at - GetTime()) .. \" <==\"\n else\n return \"\"\n end \n \nend\n",
["yOffset"] = 157.554321289063,
["anchorPoint"] = "CENTER",
["customTextUpdate"] = "update",
@@ -1429,12 +1429,12 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
--check if there is a group for our auras
--[=[
if (not WeakAurasSaved.displays ["Details! Aura Group"]) then
local group = _detalhes.table.copy ({}, group_prototype)
local group = _detalhes.table.copy({}, group_prototype)
WeakAuras.Add (group)
end
if (not WeakAurasSaved.displays ["Details! Boss Mods Group"]) then
local group = _detalhes.table.copy ({}, group_prototype_boss_mods)
local group = _detalhes.table.copy({}, group_prototype_boss_mods)
WeakAuras.Add (group)
end
--]=]
@@ -1454,7 +1454,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
icon_glow = nil
group = nil
new_aura = _detalhes.table.copy ({}, text_interrupt_prototype)
new_aura = _detalhes.table.copy({}, text_interrupt_prototype)
new_aura.trigger.custom = [[
function(event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)
@@ -1466,8 +1466,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
aura_env.interrupted = aura_env.interrupted + 1
aura_env.text = aura_env.text .. "|cffc5ffc5" .. who_name .. " (" .. aura_env.interrupted .. ") ".. "|r\n"
end
if (select(2, aura_env.text:gsub ("\n", "")) == 9) then
aura_env.text = aura_env.text:gsub (".-\n", "", 1)
if (select(2, aura_env.text:gsub("\n", "")) == 9) then
aura_env.text = aura_env.text:gsub(".-\n", "", 1)
end
return true
else
@@ -1479,8 +1479,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
end
]]
new_aura.trigger.custom = new_aura.trigger.custom:gsub ("@spellid", spellid)
new_aura.trigger.custom = new_aura.trigger.custom:gsub ("@spell_casted", icon_text)
new_aura.trigger.custom = new_aura.trigger.custom:gsub("@spellid", spellid)
new_aura.trigger.custom = new_aura.trigger.custom:gsub("@spell_casted", icon_text)
--size
new_aura.fontSize = min (icon_size, 24)
@@ -1499,7 +1499,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
icon_glow = nil
group = nil
new_aura = _detalhes.table.copy ({}, text_dispell_prototype)
new_aura = _detalhes.table.copy({}, text_dispell_prototype)
new_aura.trigger.custom = [[
function(event, time, token, hidding, who_serial, who_name, who_flags, who_flags2, alvo_serial, alvo_name, alvo_flags, alvo_flags2, spellid, spellname, spelltype, extraSpellID, extraSpellName, extraSchool)
@@ -1509,8 +1509,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
aura_env.dispels_by [who_name] = (aura_env.dispels_by [who_name] or 0) + 1
aura_env.text = aura_env.text .. "|cffd2e8ff" .. who_name .. " (" .. aura_env.dispels_by [who_name] .. ") ".. "|r\n"
if (select(2, aura_env.text:gsub ("\n", "")) == 11) then
aura_env.text = aura_env.text:gsub (".-\n", "", 2)
if (select(2, aura_env.text:gsub("\n", "")) == 11) then
aura_env.text = aura_env.text:gsub(".-\n", "", 2)
aura_env.text = "@title\n" .. aura_env.text
end
return true
@@ -1525,8 +1525,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
end
]]
new_aura.trigger.custom = new_aura.trigger.custom:gsub ("@spellid", spellid)
new_aura.trigger.custom = new_aura.trigger.custom:gsub ("@title", icon_text)
new_aura.trigger.custom = new_aura.trigger.custom:gsub("@spellid", spellid)
new_aura.trigger.custom = new_aura.trigger.custom:gsub("@title", icon_text)
--size
new_aura.fontSize = min (icon_size, 24)
@@ -1542,18 +1542,18 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
--create the default aura table
if (aura_type == "icon") then
new_aura = _detalhes.table.copy ({}, icon_dbm_timerbar_prototype)
new_aura = _detalhes.table.copy({}, icon_dbm_timerbar_prototype)
elseif (aura_type == "aurabar") then
new_aura = _detalhes.table.copy ({}, bar_dbm_timerbar_prototype)
new_aura = _detalhes.table.copy({}, bar_dbm_timerbar_prototype)
elseif (aura_type == "text") then
new_aura = _detalhes.table.copy ({}, text_dbm_timerbar_prototype)
new_aura = _detalhes.table.copy({}, text_dbm_timerbar_prototype)
end
--text and icon
if (aura_type == "aurabar") then
icon_text = icon_text:gsub ("= ", "")
icon_text = icon_text:gsub (" =", "")
icon_text = icon_text:gsub ("=", "")
icon_text = icon_text:gsub("= ", "")
icon_text = icon_text:gsub(" =", "")
icon_text = icon_text:gsub("=", "")
new_aura.displayTextLeft = icon_text
new_aura.displayIcon = icon_texture
elseif (aura_type == "icon") then
@@ -1579,25 +1579,25 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
aura_env.remaining_trigger = @countdown
]]
init_start = init_start:gsub ("@text", icon_text)
init_start = init_start:gsub ("@countdown", floor(stacksize))
new_aura.trigger.remaining = tostring (floor(stacksize))
init_start = init_start:gsub("@text", icon_text)
init_start = init_start:gsub("@countdown", floor(stacksize))
new_aura.trigger.remaining = tostring(floor(stacksize))
new_aura.actions.init.custom = init_start
if (other_values.dbm_timer_id) then
new_aura.trigger.event = "DBM Timer"
local timerId = tostring (other_values.dbm_timer_id)
local timerId = tostring(other_values.dbm_timer_id)
--print("timerId:", other_values.dbm_timer_id, type(other_values.dbm_timer_id), timerId:find ("%s"))
--print("timerId:", other_values.dbm_timer_id, type(other_values.dbm_timer_id), timerId:find("%s"))
--other_values.spellid
--if (timerId:find ("%s")) then
--if (timerId:find("%s")) then
--spellid timers
new_aura.trigger.id = ""
new_aura.trigger.use_id = false
new_aura.trigger.spellId_operator = "=="
new_aura.trigger.use_spellId = true
new_aura.trigger.spellId = tostring (other_values.spellid)
new_aura.trigger.spellId = tostring(other_values.spellid)
--else
--ej timers
-- new_aura.trigger.id = timerId
@@ -1607,7 +1607,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
new_aura.trigger.use_id = false
new_aura.trigger.spellId_operator = "=="
new_aura.trigger.use_spellId = true
new_aura.trigger.spellId = tostring (other_values.bw_timer_id)
new_aura.trigger.spellId = tostring(other_values.bw_timer_id)
new_aura.trigger.event = "BigWigs Timer"
end
@@ -1617,17 +1617,17 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
local init_start = [[
aura_env.reimaningTime = @countdown
]]
init_start = init_start:gsub ("@countdown", floor(stacksize))
trigger.remaining = tostring (floor(stacksize))
init_start = init_start:gsub("@countdown", floor(stacksize))
trigger.remaining = tostring(floor(stacksize))
new_aura.actions.init.custom = init_start
if (other_values.dbm_timer_id) then
trigger.event = "DBM Timer"
trigger.spellId = tostring (other_values.spellid)
trigger.spellId = tostring(other_values.spellid)
elseif (other_values.bw_timer_id) then
trigger.event = "BigWigs Timer"
trigger.spellId = tostring (other_values.bw_timer_id)
trigger.spellId = tostring(other_values.bw_timer_id)
trigger.spellId_operator = "=="
end
end
@@ -1635,18 +1635,18 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
else
if (aura_type == "icon") then
new_aura = _detalhes.table.copy ({}, icon_prototype)
new_aura = _detalhes.table.copy({}, icon_prototype)
elseif (aura_type == "aurabar") then
new_aura = _detalhes.table.copy ({}, aurabar_prototype)
new_aura = _detalhes.table.copy({}, aurabar_prototype)
elseif (aura_type == "text") then
new_aura = _detalhes.table.copy ({}, text_prototype)
new_aura = _detalhes.table.copy({}, text_prototype)
new_aura.displayText = spellname
end
if (target) then
if (target == 1) then --Debuff on Player
local add = _detalhes.table.copy ({}, debuff_prototype)
add.trigger.spellId = tostring (spellid)
local add = _detalhes.table.copy({}, debuff_prototype)
add.trigger.spellId = tostring(spellid)
add.trigger.spellIds[1] = "" --spellid
add.trigger.names = nil --spellname
add.trigger.auranames = {tostring(spellid)}
@@ -1663,8 +1663,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
_detalhes.table.overwrite (new_aura, add)
elseif (target == 2) then --Debuff on Target
local add = _detalhes.table.copy ({}, debuff_prototype)
add.trigger.spellId = tostring (spellid)
local add = _detalhes.table.copy({}, debuff_prototype)
add.trigger.spellId = tostring(spellid)
add.trigger.spellIds[1] = "" --spellid
add.trigger.names = nil --spellname
add.trigger.auranames = {tostring(spellid)}
@@ -1683,8 +1683,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
_detalhes.table.overwrite (new_aura, add)
elseif (target == 3) then --Debuff on Focus
local add = _detalhes.table.copy ({}, debuff_prototype)
add.trigger.spellId = tostring (spellid)
local add = _detalhes.table.copy({}, debuff_prototype)
add.trigger.spellId = tostring(spellid)
add.trigger.spellIds[1] = "" --spellid
add.trigger.names = nil --spellname
add.trigger.auranames = {tostring(spellid)}
@@ -1700,7 +1700,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
_detalhes.table.overwrite (new_aura, add)
elseif (target == 11) then --Buff on Player
local add = _detalhes.table.copy ({}, buff_prototype)
local add = _detalhes.table.copy({}, buff_prototype)
add.trigger.names = nil --spellname
add.trigger.unit = "player"
add.trigger.useName = true
@@ -1714,8 +1714,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
_detalhes.table.overwrite (new_aura, add)
elseif (target == 12) then --Buff on Target
local add = _detalhes.table.copy ({}, buff_prototype)
add.trigger.spellId = tostring (spellid)
local add = _detalhes.table.copy({}, buff_prototype)
add.trigger.spellId = tostring(spellid)
add.trigger.spellIds[1] = "" --spellid
add.trigger.names = nil --spellname
add.trigger.unit = "target"
@@ -1729,8 +1729,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
_detalhes.table.overwrite (new_aura, add)
elseif (target == 13) then --Buff on Focus
local add = _detalhes.table.copy ({}, buff_prototype)
add.trigger.spellId = tostring (spellid)
local add = _detalhes.table.copy({}, buff_prototype)
add.trigger.spellId = tostring(spellid)
add.trigger.spellIds[1] = "" --spellid
add.trigger.names = nil --spellname
add.trigger.auranames = {tostring(spellid)}
@@ -1746,8 +1746,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
_detalhes.table.overwrite (new_aura, add)
elseif (target == 21) then --Spell Cast Started
local add = _detalhes.table.copy ({}, cast_prototype)
add.trigger.spellId = tostring (spellid)
local add = _detalhes.table.copy({}, cast_prototype)
add.trigger.spellId = tostring(spellid)
add.trigger.spellName = spellname
add.trigger.subeventSuffix = "_CAST_START"
add.trigger.duration = stacksize
@@ -1758,8 +1758,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
_detalhes.table.overwrite (new_aura, add)
elseif (target == 22) then --Spell Cast Successful
local add = _detalhes.table.copy ({}, cast_prototype)
add.trigger.spellId = tostring (spellid)
local add = _detalhes.table.copy({}, cast_prototype)
add.trigger.spellId = tostring(spellid)
add.trigger.spellName = spellname
if (not use_spellid) then
add.trigger.use_spellName = true
@@ -1777,7 +1777,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
end
else
new_aura.trigger.spellId = tostring (spellid)
new_aura.trigger.spellId = tostring(spellid)
new_aura.trigger.name = spellname
tinsert(new_aura.trigger.spellIds, spellid)
end
@@ -1796,8 +1796,8 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
--check stack size
if (stacksize and stacksize >= 1) then
stacksize = floor(stacksize)
local add = _detalhes.table.copy ({}, stack_prototype)
add.trigger.count = tostring (stacksize)
local add = _detalhes.table.copy({}, stack_prototype)
add.trigger.count = tostring(stacksize)
_detalhes.table.overwrite (new_aura, add)
end
@@ -1806,7 +1806,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
if (aura_type == "text") then
new_aura.displayText = icon_text
else
local add = _detalhes.table.copy ({}, widget_text_prototype)
local add = _detalhes.table.copy({}, widget_text_prototype)
add.displayStacks = icon_text
_detalhes.table.overwrite (new_aura, add)
end
@@ -1831,25 +1831,25 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
if (encounter_id) then
new_aura.load = new_aura.load or {}
new_aura.load.use_encounterid = true
new_aura.load.encounterid = tostring (encounter_id)
new_aura.load.encounterid = tostring(encounter_id)
end
--using sound
if (sound and type(sound) == "table") then
local add = _detalhes.table.copy ({}, sound_prototype_custom)
local add = _detalhes.table.copy({}, sound_prototype_custom)
add.actions.start.sound_path = sound.sound_path
add.actions.start.sound_channel = sound.sound_channel or "Master"
_detalhes.table.overwrite (new_aura, add)
elseif (sound and sound ~= "" and not sound:find ("Quiet.ogg")) then
local add = _detalhes.table.copy ({}, sound_prototype)
elseif (sound and sound ~= "" and not sound:find("Quiet.ogg")) then
local add = _detalhes.table.copy({}, sound_prototype)
add.actions.start.sound = sound
_detalhes.table.overwrite (new_aura, add)
end
--chat message
if (chat and chat ~= "") then
local add = _detalhes.table.copy ({}, chat_prototype)
local add = _detalhes.table.copy({}, chat_prototype)
add.actions.start.message = chat
_detalhes.table.overwrite (new_aura, add)
end
@@ -1866,7 +1866,7 @@ function _detalhes:CreateWeakAura (aura_type, spellid, use_spellid, spellname, n
--check is is using glow effect
if (icon_glow) then
local add = _detalhes.table.copy ({}, glow_prototype)
local add = _detalhes.table.copy({}, glow_prototype)
add.actions.start.glow_frame = "WeakAuras:" .. new_aura.id
_detalhes.table.overwrite (new_aura, add)
end
@@ -1971,11 +1971,11 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
--check if there is a group for our auras
if (WeakAuras and WeakAurasSaved) then
if (not WeakAurasSaved.displays ["Details! Aura Group"]) then
local group = _detalhes.table.copy ({}, group_prototype)
local group = _detalhes.table.copy({}, group_prototype)
WeakAuras.Add (group)
end
if (not WeakAurasSaved.displays ["Details! Boss Mods Group"]) then
local group = _detalhes.table.copy ({}, group_prototype_boss_mods)
local group = _detalhes.table.copy({}, group_prototype_boss_mods)
WeakAuras.Add (group)
end
end
@@ -2053,7 +2053,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
--aura name
local name_label = fw:CreateLabel(f, "Aura Name: ", nil, nil, "GameFontNormal")
local name_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraName", "$parentAuraName")
local name_textentry = fw:CreateTextEntry(f, _detalhes.empty_function, 150, 20, "AuraName", "$parentAuraName")
name_textentry:SetTemplate(slider_template)
name_textentry:SetPoint("left", name_label, "right", 2, 0)
f.name = name_textentry
@@ -2129,7 +2129,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
f.OnSelectAuraType = OnSelectAuraType
local AuraTypeBackground = f:CreateTexture(nil, "border")
AuraTypeBackground:SetColorTexture (.4, .4, .4, .1)
AuraTypeBackground:SetColorTexture(.4, .4, .4, .1)
AuraTypeBackground:SetHeight(64)
AuraTypeBackground:SetPoint("topleft", f, "topleft", 10, -79)
AuraTypeBackground:SetPoint("topright", f, "topright", -10, -79)
@@ -2244,7 +2244,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
--spellname
local spellname_label = fw:CreateLabel(f, "Spell Name: ", nil, nil, "GameFontNormal")
local spellname_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "SpellName", "$parentSpellName")
local spellname_textentry = fw:CreateTextEntry(f, _detalhes.empty_function, 150, 20, "SpellName", "$parentSpellName")
spellname_textentry:SetTemplate(slider_template)
spellname_textentry:SetPoint("left", spellname_label, "right", 2, 0)
f.spellname = spellname_textentry
@@ -2252,7 +2252,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
--spellid
local auraid_label = fw:CreateLabel(f, "Spell Id: ", nil, nil, "GameFontNormal")
local auraid_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraSpellId", "$parentAuraSpellId")
local auraid_textentry = fw:CreateTextEntry(f, _detalhes.empty_function, 150, 20, "AuraSpellId", "$parentAuraSpellId")
auraid_textentry:SetTemplate(slider_template)
auraid_textentry:Disable()
auraid_textentry:SetPoint("left", auraid_label, "right", 2, 0)
@@ -2280,7 +2280,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
f.IconButton.icon.texture = texture
end
local icon_pick_button = fw:NewButton(f, nil, "$parentIconButton", "IconButton", 20, 20, function() fw:IconPick (icon_button_func, true) end)
local icon_button_icon = fw:NewImage (icon_pick_button, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon")
local icon_button_icon = fw:NewImage(icon_pick_button, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon")
icon_pick_button:InstallCustomTexture()
icon_pick_button:SetPoint("left", icon_label, "right", 2, 0)
@@ -2359,7 +2359,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
local already_added = {}
for name, soundFile in pairs(game_sounds) do
name = name:gsub ("(%a)([%w_']*)", titlecase)
name = name:gsub("(%a)([%w_']*)", titlecase)
if (not already_added [name]) then
sounds [#sounds+1] = {name = name, file = soundFile, gamesound = true}
already_added [name] = true
@@ -2367,7 +2367,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
end
for name, soundFile in pairs(LibStub:GetLibrary("LibSharedMedia-3.0"):HashTable ("sound")) do
name = name:gsub ("(%a)([%w_']*)", titlecase)
name = name:gsub("(%a)([%w_']*)", titlecase)
if (not already_added [name]) then
sounds [#sounds+1] = {name = name, file = soundFile}
already_added [name] = true
@@ -2376,7 +2376,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
if (WeakAuras and WeakAuras.sound_types) then
for soundFile, name in pairs(WeakAuras.sound_types) do
name = name:gsub ("(%a)([%w_']*)", titlecase)
name = name:gsub("(%a)([%w_']*)", titlecase)
if (not already_added [name]) then
sounds [#sounds+1] = {name = name, file = soundFile}
end
@@ -2386,7 +2386,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
table.sort (sounds, sort)
for _, sound in ipairs(sounds) do
if (sound.name:find ("D_")) then --details sound
if (sound.name:find("D_")) then --details sound
tinsert(t, {color = "orange", label = sound.name, value = sound.file, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound, iconsize = iconsize})
elseif (sound.gamesound) then --game sound
tinsert(t, {color = "yellow", label = sound.name, value = {sound_path = sound.file}, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound, iconsize = iconsize})
@@ -2404,14 +2404,14 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
--say something
local say_something_label = fw:CreateLabel(f, "/Say on Trigger: ", nil, nil, "GameFontNormal")
local say_something = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "SaySomething", "$parentSaySomething")
local say_something = fw:CreateTextEntry(f, _detalhes.empty_function, 150, 20, "SaySomething", "$parentSaySomething")
say_something:SetTemplate(slider_template)
say_something:SetPoint("left", say_something_label, "right", 2, 0)
say_something.tooltip = "Your character /say this phrase when the aura triggers."
--aura text
local aura_text_label = fw:CreateLabel(f, "Aura Text: ", nil, nil, "GameFontNormal")
local aura_text = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraText", "$parentAuraText")
local aura_text = fw:CreateTextEntry(f, _detalhes.empty_function, 150, 20, "AuraText", "$parentAuraText")
aura_text:SetTemplate(slider_template)
aura_text:SetPoint("left", aura_text_label, "right", 2, 0)
aura_text.tooltip = "Text shown at aura's icon right side."
@@ -2442,7 +2442,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
--encounter id
local encounterid_label = fw:CreateLabel(f, "Encounter ID: ", nil, nil, "GameFontNormal")
local encounterid = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "EncounterIdText", "$parentEncounterIdText")
local encounterid = fw:CreateTextEntry(f, _detalhes.empty_function, 150, 20, "EncounterIdText", "$parentEncounterIdText")
encounterid:SetTemplate(slider_template)
encounterid:SetPoint("left", encounterid_label, "right", 2, 0)
encounterid.tooltip = "Only load this aura for this raid encounter."
@@ -2517,7 +2517,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
end
--make a copy of the prototype
local newGroup = _detalhes.table.copy ({}, group_prototype)
local newGroup = _detalhes.table.copy({}, group_prototype)
--set group settings
newGroup.id = groupName
@@ -2537,7 +2537,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
end
local weakauras_newgroup_label = fw:CreateLabel(f, "New WeakAuras Group: ", nil, nil, "GameFontNormal")
local weakauras_newgroup_textentry = fw:CreateTextEntry (f, create_wa_group, 150, 20, "NewWeakaurasGroupTextEntry", "$parentNewWeakaurasGroup")
local weakauras_newgroup_textentry = fw:CreateTextEntry(f, create_wa_group, 150, 20, "NewWeakaurasGroupTextEntry", "$parentNewWeakaurasGroup")
weakauras_newgroup_textentry:SetTemplate(slider_template)
weakauras_newgroup_textentry:SetPoint("left", weakauras_newgroup_label, "right", 2, 0)
f.weakauras_newgroup = weakauras_newgroup_textentry
@@ -2710,7 +2710,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
f.AuraText:SetText("=Not Interrupted!=")
aura_text_label.text = "Not Interrupted: "
elseif (trigger == 42) then
f.AuraText:SetText(DetailsAuraPanel.name.text:gsub ("%(d!%)", "") .. "Dispells")
f.AuraText:SetText(DetailsAuraPanel.name.text:gsub("%(d!%)", "") .. "Dispells")
aura_text_label.text = "Title Text: "
end
end
@@ -2750,7 +2750,7 @@ function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid, tr
DetailsAuraPanel.name.text = spellname .. " (d!)"
DetailsAuraPanel.spellname.text = spellname
DetailsAuraPanel.AuraSpellId.text = tostring (spellid)
DetailsAuraPanel.AuraSpellId.text = tostring(spellid)
DetailsAuraPanel.icon.texture = spellicon
DetailsAuraPanel.UseGlow.glow_test.animIn:Stop()
+54 -54
View File
@@ -49,7 +49,7 @@ function _detalhes:OpenWelcomeWindow()
local logotipo = window:CreateTexture(nil, "overlay")
logotipo:SetPoint("topleft", window, "topleft", 16, -20)
logotipo:SetTexture([[Interface\Addons\Details\images\logotipo]])
logotipo:SetTexCoord (0.07421875, 0.73828125, 0.51953125, 0.890625)
logotipo:SetTexCoord(0.07421875, 0.73828125, 0.51953125, 0.890625)
logotipo:SetWidth(186)
logotipo:SetHeight(50)
@@ -66,7 +66,7 @@ function _detalhes:OpenWelcomeWindow()
cancel:Disable()
local cancelText = cancel:CreateFontString(nil, "overlay", "GameFontNormal")
cancelText:SetTextColor (1, 1, 1)
cancelText:SetTextColor(1, 1, 1)
cancelText:SetPoint("left", cancel, "right", 2, 0)
cancelText:SetText(Loc ["STRING_WELCOME_69"])
@@ -238,7 +238,7 @@ local window_openned_at = time()
local angel = window:CreateTexture(nil, "border")
angel:SetPoint("bottomright", window, "bottomright")
angel:SetTexture([[Interface\TUTORIALFRAME\UI-TUTORIALFRAME-SPIRITREZ]])
angel:SetTexCoord (0.162109375, 0.591796875, 0, 1)
angel:SetTexCoord(0.162109375, 0.591796875, 0, 1)
angel:SetWidth(442)
angel:SetHeight(256)
angel:SetAlpha(.2)
@@ -263,7 +263,7 @@ local window_openned_at = time()
bg55:SetHeight(125*3)
bg55:SetWidth(89*3)
bg55:SetAlpha(.05)
bg55:SetTexCoord (1, 0, 0, 1)
bg55:SetTexCoord(1, 0, 0, 1)
local texto55 = window:CreateFontString(nil, "overlay", "GameFontNormal")
texto55:SetPoint("topleft", window, "topleft", 20, -80)
@@ -271,7 +271,7 @@ local window_openned_at = time()
local texto555 = window:CreateFontString(nil, "overlay", "GameFontNormal")
texto555:SetText(Loc ["STRING_WELCOME_45"])
texto555:SetTextColor (1, 1, 1, 1)
texto555:SetTextColor(1, 1, 1, 1)
local changemind = g:NewLabel(window, _, "$parentChangeMind55Label", "changemind55Label", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange")
window.changemind55Label:SetPoint("center", window, "center")
@@ -285,14 +285,14 @@ local window_openned_at = time()
texto_appearance:SetHeight(100)
texto_appearance:SetJustifyH("left")
texto_appearance:SetJustifyV ("top")
texto_appearance:SetTextColor (1, 1, 1, 1)
texto_appearance:SetTextColor(1, 1, 1, 1)
local skins_image = window:CreateTexture(nil, "overlay")
skins_image:SetTexture([[Interface\Addons\Details\images\icons2]])
skins_image:SetPoint("topright", window, "topright", -50, -24)
skins_image:SetWidth(214*0.7)
skins_image:SetHeight(133*0.7)
skins_image:SetTexCoord (0, 0.41796875, 0, 0.259765625) --0, 0, 214 133
skins_image:SetTexCoord(0, 0.41796875, 0, 0.259765625) --0, 0, 214 133
--skin
local onSelectSkin = function(_, _, skin_name)
@@ -334,7 +334,7 @@ local window_openned_at = time()
texto_alphabet:SetText(Loc ["STRING_WELCOME_73"]) --"Select the Alphabet or Region:"
texto_alphabet:SetJustifyH("left")
texto_alphabet:SetJustifyV ("top")
texto_alphabet:SetTextColor (1, 1, 1)
texto_alphabet:SetTextColor(1, 1, 1)
texto_alphabet:SetPoint("topleft", skin_label.widget, "bottomleft", 0, -20)
local allAlphabetCheckBoxes = {}
@@ -697,7 +697,7 @@ local window_openned_at = time()
numeral_image:SetHeight(125*3)--125
numeral_image:SetWidth(89*3)--82
numeral_image:SetAlpha(.05)
numeral_image:SetTexCoord (1, 0, 0, 1)
numeral_image:SetTexCoord(1, 0, 0, 1)
g:NewLabel(window, _, "$parentChangeMindNumeralLabel", "changemindNumeralLabel", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange")
window.changemindNumeralLabel:SetPoint("center", window, "center")
@@ -746,16 +746,16 @@ local window_openned_at = time()
sword_icon2:SetTexture([[Interface\Addons\Details\images\icons2]])
sword_icon2:SetPoint("topright", window, "topright", -30, -10)
sword_icon2:SetSize(128*1.4, 64*1.4)
sword_icon2:SetTexCoord (330/512, 509/512, 437/512, 509/512)
sword_icon2:SetDrawLayer ("overlay", 2)
sword_icon2:SetTexCoord(330/512, 509/512, 437/512, 509/512)
sword_icon2:SetDrawLayer("overlay", 2)
local thedude2 = window:CreateTexture(nil, "overlay")
--thedude2:SetTexture([[Interface\TUTORIALFRAME\UI-TutorialFrame-TheDude]])
thedude2:SetPoint("bottomright", sword_icon, "bottomleft", 70, 19)
thedude2:SetWidth(128*1.0)
thedude2:SetHeight(128*1.0)
thedude2:SetTexCoord (0, 1, 0, 1)
thedude2:SetDrawLayer ("overlay", 3)
thedude2:SetTexCoord(0, 1, 0, 1)
thedude2:SetDrawLayer("overlay", 3)
local NumeralType1_text = window:CreateFontString(nil, "overlay", "GameFontNormal")
NumeralType1_text:SetText("1K = 1.000 |cFFFFCC00| |r10K = 10.000 |cFFFFCC00| |r100K = 100.000 |cFFFFCC00| |r1M = 1.000.000")
@@ -763,7 +763,7 @@ local window_openned_at = time()
NumeralType1_text:SetHeight(40)
NumeralType1_text:SetJustifyH("left")
NumeralType1_text:SetJustifyV ("top")
NumeralType1_text:SetTextColor (.8, .8, .8, 1)
NumeralType1_text:SetTextColor(.8, .8, .8, 1)
NumeralType1_text:SetPoint("topleft", window, "topleft", 40, -150)
local NumeralType2_text = window:CreateFontString(nil, "overlay", "GameFontNormal")
@@ -775,7 +775,7 @@ local window_openned_at = time()
--if region is western it'll be using Korean symbols, set a font on the dropdown so it won't show ?????
local clientRegion = _detalhes.gump:GetClientRegion()
if (clientRegion == "western" or clientRegion == "russia") then
_detalhes.gump:SetFontFace (NumeralType2_text, _detalhes.gump:GetBestFontForLanguage ("koKR"))
_detalhes.gump:SetFontFace (NumeralType2_text, _detalhes.gump:GetBestFontForLanguage("koKR"))
else
_detalhes.gump:SetFontFace (NumeralType2_text, _detalhes.gump:GetBestFontForLanguage())
@@ -788,7 +788,7 @@ local window_openned_at = time()
NumeralType2_text:SetHeight(80)
NumeralType2_text:SetJustifyH("left")
NumeralType2_text:SetJustifyV ("top")
NumeralType2_text:SetTextColor (.8, .8, .8, 1)
NumeralType2_text:SetTextColor(.8, .8, .8, 1)
NumeralType2_text:SetPoint("topleft", window, "topleft", 40, -220)
if (_detalhes.numerical_system == 1) then --west
@@ -816,7 +816,7 @@ local window_openned_at = time()
ampulheta:SetHeight(125*3)--125
ampulheta:SetWidth(89*3)--82
ampulheta:SetAlpha(.05)
ampulheta:SetTexCoord (1, 0, 0, 1)
ampulheta:SetTexCoord(1, 0, 0, 1)
g:NewLabel(window, _, "$parentChangeMind2Label", "changemind2Label", Loc ["STRING_WELCOME_2"], "GameFontNormal", 9, "orange")
window.changemind2Label:SetPoint("center", window, "center")
@@ -865,16 +865,16 @@ local window_openned_at = time()
sword_icon:SetPoint("topright", window, "topright", -15, -30)
sword_icon:SetWidth(64*1.4)
sword_icon:SetHeight(64*1.4)
sword_icon:SetTexCoord (1, 0, 0, 1)
sword_icon:SetDrawLayer ("overlay", 2)
sword_icon:SetTexCoord(1, 0, 0, 1)
sword_icon:SetDrawLayer("overlay", 2)
local thedude = window:CreateTexture(nil, "overlay")
thedude:SetTexture([[Interface\TUTORIALFRAME\UI-TutorialFrame-TheDude]])
thedude:SetPoint("bottomright", sword_icon, "bottomleft", 70, 19)
thedude:SetWidth(128*1.0)
thedude:SetHeight(128*1.0)
thedude:SetTexCoord (0, 1, 0, 1)
thedude:SetDrawLayer ("overlay", 3)
thedude:SetTexCoord(0, 1, 0, 1)
thedude:SetDrawLayer("overlay", 3)
local chronometer_text = window:CreateFontString(nil, "overlay", "GameFontNormal")
chronometer_text:SetText(Loc ["STRING_WELCOME_6"])
@@ -882,7 +882,7 @@ local window_openned_at = time()
chronometer_text:SetHeight(40)
chronometer_text:SetJustifyH("left")
chronometer_text:SetJustifyV ("top")
chronometer_text:SetTextColor (.8, .8, .8, 1)
chronometer_text:SetTextColor(.8, .8, .8, 1)
chronometer_text:SetPoint("topleft", window.ChronometerLabel.widget, "topright", 20, 0)
local continuous_text = window:CreateFontString(nil, "overlay", "GameFontNormal")
@@ -891,7 +891,7 @@ local window_openned_at = time()
continuous_text:SetHeight(40)
continuous_text:SetJustifyH("left")
continuous_text:SetJustifyV ("top")
continuous_text:SetTextColor (.8, .8, .8, 1)
continuous_text:SetTextColor(.8, .8, .8, 1)
continuous_text:SetPoint("topleft", window.ContinuousLabel.widget, "topright", 20, 0)
if (_detalhes.time_type == 1) then --chronometer
@@ -956,7 +956,7 @@ local window_openned_at = time()
bg:SetHeight(125*3)--125
bg:SetWidth(89*3)--82
bg:SetAlpha(.05)
bg:SetTexCoord (1, 0, 0, 1)
bg:SetTexCoord(1, 0, 0, 1)
g:NewLabel(window, _, "$parentChangeMind4Label", "changemind4Label", Loc ["STRING_WELCOME_11"], "GameFontNormal", 9, "orange")
window.changemind4Label:SetPoint("center", window, "center")
@@ -973,7 +973,7 @@ local window_openned_at = time()
interval_text:SetHeight(40)
interval_text:SetJustifyH("left")
interval_text:SetJustifyV ("top")
interval_text:SetTextColor (1, 1, 1, .9)
interval_text:SetTextColor(1, 1, 1, .9)
interval_text:SetPoint("topleft", window, "topleft", 30, -110)
local dance_text = window:CreateFontString(nil, "overlay", "GameFontNormal")
@@ -982,7 +982,7 @@ local window_openned_at = time()
dance_text:SetHeight(40)
dance_text:SetJustifyH("left")
dance_text:SetJustifyV ("top")
dance_text:SetTextColor (1, 1, 1, 1)
dance_text:SetTextColor(1, 1, 1, 1)
dance_text:SetPoint("topleft", window, "topleft", 30, -175)
--------------- Update Speed
@@ -997,11 +997,11 @@ local window_openned_at = time()
window.updatespeedSlider.useDecimals = true
local updateColor = function(slider, value)
if (value < 1) then
slider.amt:SetTextColor (1, value, 0)
slider.amt:SetTextColor(1, value, 0)
elseif (value > 1) then
slider.amt:SetTextColor (-(value-3), 1, 0)
slider.amt:SetTextColor(-(value-3), 1, 0)
else
slider.amt:SetTextColor (1, 1, 0)
slider.amt:SetTextColor(1, 1, 0)
end
end
@@ -1072,8 +1072,8 @@ local window_openned_at = time()
mech_icon2:SetWidth(128*1.0)
mech_icon2:SetHeight(128*0.6)
mech_icon2:SetAlpha(0.6)
mech_icon2:SetTexCoord (0, 1, 40/128, 1)
mech_icon2:SetDrawLayer ("overlay", 2)
mech_icon2:SetTexCoord(0, 1, 40/128, 1)
mech_icon2:SetDrawLayer("overlay", 2)
local update_frame_alert = CreateFrame("frame", nil, window)
update_frame_alert:SetScript("OnShow", function()
@@ -1123,7 +1123,7 @@ local window_openned_at = time()
bg6:SetHeight(125*3)--125
bg6:SetWidth(89*3)--82
bg6:SetAlpha(.1)
bg6:SetTexCoord (1, 0, 0, 1)
bg6:SetTexCoord(1, 0, 0, 1)
local texto5 = window:CreateFontString(nil, "overlay", "GameFontNormal")
texto5:SetPoint("topleft", window, "topleft", 20, -80)
@@ -1136,14 +1136,14 @@ local window_openned_at = time()
texto_stretch:SetHeight(100)
texto_stretch:SetJustifyH("left")
texto_stretch:SetJustifyV ("top")
texto_stretch:SetTextColor (1, 1, 1, 1)
texto_stretch:SetTextColor(1, 1, 1, 1)
local stretch_image = window:CreateTexture(nil, "overlay")
stretch_image:SetTexture([[Interface\Addons\Details\images\icons]])
stretch_image:SetPoint("right", texto_stretch, "left", -12, 0)
stretch_image:SetWidth(144)
stretch_image:SetHeight(61)
stretch_image:SetTexCoord (0.716796875, 1, 0.876953125, 1)
stretch_image:SetTexCoord(0.716796875, 1, 0.876953125, 1)
local stretch_frame_alert = CreateFrame("frame", nil, window)
stretch_frame_alert:SetScript("OnHide", function()
@@ -1181,7 +1181,7 @@ local window_openned_at = time()
bg6:SetHeight(125*3)--125
bg6:SetWidth(89*3)--82
bg6:SetAlpha(.1)
bg6:SetTexCoord (1, 0, 0, 1)
bg6:SetTexCoord(1, 0, 0, 1)
local texto6 = window:CreateFontString(nil, "overlay", "GameFontNormal")
texto6:SetPoint("topleft", window, "topleft", 20, -80)
@@ -1194,14 +1194,14 @@ local window_openned_at = time()
texto_instance_button:SetHeight(100)
texto_instance_button:SetJustifyH("left")
texto_instance_button:SetJustifyV ("top")
texto_instance_button:SetTextColor (1, 1, 1, 1)
texto_instance_button:SetTextColor(1, 1, 1, 1)
local instance_button_image = window:CreateTexture(nil, "overlay")
instance_button_image:SetTexture([[Interface\Addons\Details\images\icons]])
instance_button_image:SetPoint("topright", window, "topright", -16, -70)
instance_button_image:SetWidth(198)
instance_button_image:SetHeight(141)
instance_button_image:SetTexCoord (0.328125, 0.71484375, 0.724609375, 1)
instance_button_image:SetTexCoord(0.328125, 0.71484375, 0.724609375, 1)
local instance_frame_alert = CreateFrame("frame", nil, window)
instance_frame_alert:SetScript("OnHide", function()
@@ -1237,7 +1237,7 @@ local window_openned_at = time()
bg7:SetHeight(125*3)--125
bg7:SetWidth(89*3)--82
bg7:SetAlpha(.1)
bg7:SetTexCoord (1, 0, 0, 1)
bg7:SetTexCoord(1, 0, 0, 1)
local texto7 = window:CreateFontString(nil, "overlay", "GameFontNormal")
texto7:SetPoint("topleft", window, "topleft", 20, -80)
@@ -1250,14 +1250,14 @@ local window_openned_at = time()
texto_shortcut:SetHeight(160)
texto_shortcut:SetJustifyH("left")
texto_shortcut:SetJustifyV ("top")
texto_shortcut:SetTextColor (1, 1, 1, 1)
texto_shortcut:SetTextColor(1, 1, 1, 1)
local shortcut_image2 = window:CreateTexture(nil, "overlay")
shortcut_image2:SetTexture([[Interface\Addons\Details\images\icons]])
shortcut_image2:SetPoint("topright", window, "topright", -22, -87)
shortcut_image2:SetWidth(165)
shortcut_image2:SetHeight(119)
shortcut_image2:SetTexCoord (2/512, 167/512, 306/512, 425/512)
shortcut_image2:SetTexCoord(2/512, 167/512, 306/512, 425/512)
local instance1 = _detalhes:GetInstance(1)
@@ -1268,17 +1268,17 @@ local window_openned_at = time()
bookmark_frame:SetBackdrop({bgFile = [[Interface\AddOns\Details\images\background]], tile = true, tileSize = 64})
bookmark_frame:SetBackdropColor(0, 0, 0, 0.8)
local desc_anchor_topleft = _detalhes.gump:NewImage (bookmark_frame, [[Interface\AddOns\Details\images\options_window]], 75, 106, "artwork", {0.19921875, 0.2724609375, 0.6796875, 0.783203125}, "descAnchorBottomLeftImage", "$parentDescAnchorBottomLeftImage") --204 696 279 802
local desc_anchor_topleft = _detalhes.gump:NewImage(bookmark_frame, [[Interface\AddOns\Details\images\options_window]], 75, 106, "artwork", {0.19921875, 0.2724609375, 0.6796875, 0.783203125}, "descAnchorBottomLeftImage", "$parentDescAnchorBottomLeftImage") --204 696 279 802
desc_anchor_topleft:SetPoint("topleft", bookmark_frame, "topleft", -5, 5)
local desc_anchor_bottomleft = _detalhes.gump:NewImage (bookmark_frame, [[Interface\AddOns\Details\images\options_window]], 75, 106, "artwork", {0.2724609375, 0.19921875, 0.783203125, 0.6796875}, "descAnchorTopLeftImage", "$parentDescAnchorTopLeftImage") --204 696 279 802
local desc_anchor_bottomleft = _detalhes.gump:NewImage(bookmark_frame, [[Interface\AddOns\Details\images\options_window]], 75, 106, "artwork", {0.2724609375, 0.19921875, 0.783203125, 0.6796875}, "descAnchorTopLeftImage", "$parentDescAnchorTopLeftImage") --204 696 279 802
desc_anchor_bottomleft:SetPoint("bottomright", bookmark_frame, "bottomright", 5, -5)
local bmf_string = bookmark_frame:CreateFontString("overlay", nil, "GameFontNormal")
bmf_string:SetPoint("center", bookmark_frame, "center")
bmf_string:SetText(Loc ["STRING_WELCOME_65"])
local bg_string = _detalhes.gump:NewImage (bookmark_frame, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-RecentHeader]], 256, 32, "border", {0, 1, 0, 23/32})
local bg_string = _detalhes.gump:NewImage(bookmark_frame, [[Interface\ACHIEVEMENTFRAME\UI-Achievement-RecentHeader]], 256, 32, "border", {0, 1, 0, 23/32})
bg_string:SetPoint("left", bookmark_frame, "left", 0, 0)
bg_string:SetPoint("right", bookmark_frame, "right", 0, 0)
bg_string:SetPoint("center", bmf_string, "center", 0, 0)
@@ -1306,7 +1306,7 @@ local window_openned_at = time()
bg77:SetHeight(125*3)--125
bg77:SetWidth(89*3)--82
bg77:SetAlpha(.1)
bg77:SetTexCoord (1, 0, 0, 1)
bg77:SetTexCoord(1, 0, 0, 1)
local texto77 = window:CreateFontString(nil, "overlay", "GameFontNormal")
texto77:SetPoint("topleft", window, "topleft", 20, -80)
@@ -1319,7 +1319,7 @@ local window_openned_at = time()
texto_snap:SetHeight(110)
texto_snap:SetJustifyH("left")
texto_snap:SetJustifyV ("top")
texto_snap:SetTextColor (1, 1, 1, 1)
texto_snap:SetTextColor(1, 1, 1, 1)
local fonte, _, flags = texto_snap:GetFont()
texto_snap:SetFont (fonte, 11, flags)
@@ -1328,7 +1328,7 @@ local window_openned_at = time()
snap_image1:SetPoint("topright", window, "topright", -12, -95)
snap_image1:SetWidth(310)
snap_image1:SetHeight(102)
snap_image1:SetTexCoord (0, 0.60546875, 191/512, 293/512)
snap_image1:SetTexCoord(0, 0.60546875, 191/512, 293/512)
local group_frame_alert = CreateFrame("frame", nil, window)
group_frame_alert:SetScript("OnShow", function()
@@ -1352,7 +1352,7 @@ local window_openned_at = time()
bg88:SetHeight(125*3)--125
bg88:SetWidth(89*3)--82
bg88:SetAlpha(.1)
bg88:SetTexCoord (1, 0, 0, 1)
bg88:SetTexCoord(1, 0, 0, 1)
local texto88 = window:CreateFontString(nil, "overlay", "GameFontNormal")
texto88:SetPoint("topleft", window, "topleft", 20, -80)
@@ -1365,14 +1365,14 @@ local window_openned_at = time()
texto_micro_display:SetHeight(110)
texto_micro_display:SetJustifyH("left")
texto_micro_display:SetJustifyV ("top")
texto_micro_display:SetTextColor (1, 1, 1, 1)
texto_micro_display:SetTextColor(1, 1, 1, 1)
local micro_image1 = window:CreateTexture(nil, "overlay")
micro_image1:SetTexture([[Interface\Addons\Details\images\icons]])
micro_image1:SetPoint("topright", window, "topright", -15, -70)
micro_image1:SetWidth(186)
micro_image1:SetHeight(100)
micro_image1:SetTexCoord (326/512, 1, 85/512, 185/512)
micro_image1:SetTexCoord(326/512, 1, 85/512, 185/512)
local tooltip_frame = CreateFrame("frame", nil, window)
tooltip_frame:SetScript("OnShow", function(self)
@@ -1475,7 +1475,7 @@ local window_openned_at = time()
bg11:SetHeight(125*3)--125
bg11:SetWidth(89*3)--82
bg11:SetAlpha(.1)
bg11:SetTexCoord (1, 0, 0, 1)
bg11:SetTexCoord(1, 0, 0, 1)
local texto11 = window:CreateFontString(nil, "overlay", "GameFontNormal")
texto11:SetPoint("topleft", window, "topleft", 20, -80)
@@ -1488,7 +1488,7 @@ local window_openned_at = time()
texto_plugins:SetHeight(110)
texto_plugins:SetJustifyH("left")
texto_plugins:SetJustifyV ("top")
texto_plugins:SetTextColor (1, 1, 1, 1)
texto_plugins:SetTextColor(1, 1, 1, 1)
--local fonte, _, flags = texto_plugins:GetFont()
--texto_plugins:SetFont (fonte, 11, flags)
@@ -1497,7 +1497,7 @@ local window_openned_at = time()
plugins_image1:SetPoint("topright", window, "topright", -12, -90)
plugins_image1:SetWidth(281)
plugins_image1:SetHeight(81)
plugins_image1:SetTexCoord (216/512, 497/512, 6/512, 95/512)
plugins_image1:SetTexCoord(216/512, 497/512, 6/512, 95/512)
pages [#pages+1] = {bg11, texto11, plugins_image1, texto_plugins}
@@ -1514,7 +1514,7 @@ local window_openned_at = time()
bg8:SetHeight(125*3)--125
bg8:SetWidth(89*3)--82
bg8:SetAlpha(.1)
bg8:SetTexCoord (1, 0, 0, 1)
bg8:SetTexCoord(1, 0, 0, 1)
local texto8 = window:CreateFontString(nil, "overlay", "GameFontNormal")
texto8:SetPoint("topleft", window, "topleft", 20, -80)
@@ -1527,7 +1527,7 @@ local window_openned_at = time()
texto:SetHeight(90)
texto:SetJustifyH("left")
texto:SetJustifyV ("top")
texto:SetTextColor (1, 1, 1, 1)
texto:SetTextColor(1, 1, 1, 1)
local final_frame = CreateFrame("frame", nil, window)
final_frame:SetSize(1, 1)
+1 -1
View File
@@ -218,7 +218,7 @@ do
if (not name) then
return
end
if (name == encountername or name:find (encountername)) then
if (name == encountername or name:find(encountername)) then
return i, DetailsFramework.EncounterJournal.EJ_GetEncounterInfoByIndex (i, EJID)
end
end
+2 -2
View File
@@ -143,7 +143,7 @@ function Details:CreateCallbackListeners()
if (_G.DBM) then
local dbm_timer_callback = function(bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid)
local spell = tostring (spellId)
local spell = tostring(spellId)
if (spell and not current_table_dbm [spell]) then
current_table_dbm [spell] = {spell, id, msg, timer, icon, bartype, spellId, colorId, modid}
end
@@ -156,7 +156,7 @@ function Details:CreateCallbackListeners()
function Details:RegisterBigWigsCallBack()
if (BigWigsLoader) then
function Details:BigWigs_StartBar (event, module, spellid, bar_text, time, icon, ...)
spellid = tostring (spellid)
spellid = tostring(spellid)
if (not current_table_bigwigs [spellid]) then
current_table_bigwigs [spellid] = {(type(module) == "string" and module) or (module and module.moduleName) or "", spellid or "", bar_text or "", time or 0, icon or ""}
end
+4 -4
View File
@@ -127,16 +127,16 @@ do
function _detalhes:GetOnlyName(string)
if (string) then
return string:gsub (("%-.*"), "")
return string:gsub(("%-.*"), "")
end
return self.nome:gsub (("%-.*"), "")
return self.nome:gsub(("%-.*"), "")
end
function _detalhes:RemoveOwnerName (string)
if (string) then
return string:gsub ((" <.*"), "")
return string:gsub((" <.*"), "")
end
return self.nome:gsub ((" <.*"), "")
return self.nome:gsub((" <.*"), "")
end
function _detalhes:GetCLName(id)
+19 -19
View File
@@ -43,8 +43,8 @@ local create_deathrecap_line = function(parent, n)
local backgroundTextureOverlay = line:CreateTexture(nil, "artwork")
local spellIcon = line:CreateTexture(nil, "overlay")
local spellIconBorder = line:CreateTexture(nil, "overlay")
spellIcon:SetDrawLayer ("overlay", 1)
spellIconBorder:SetDrawLayer ("overlay", 2)
spellIcon:SetDrawLayer("overlay", 1)
spellIconBorder:SetDrawLayer("overlay", 2)
local sourceName = line:CreateFontString(nil, "overlay", "GameFontNormal")
local amount = line:CreateFontString(nil, "overlay", "GameFontNormal")
local lifePercent = line:CreateFontString(nil, "overlay", "GameFontNormal")
@@ -53,14 +53,14 @@ local create_deathrecap_line = function(parent, n)
--grave icon
local graveIcon = line:CreateTexture(nil, "overlay")
graveIcon:SetTexture([[Interface\MINIMAP\POIIcons]])
graveIcon:SetTexCoord (146/256, 160/256, 0/512, 18/512)
graveIcon:SetTexCoord(146/256, 160/256, 0/512, 18/512)
graveIcon:SetPoint("left", line, "left", 11, 0)
graveIcon:SetSize(14, 18)
--spell icon
spellIcon:SetSize(19, 19)
spellIconBorder:SetTexture([[Interface\ENCOUNTERJOURNAL\LootTab]])
spellIconBorder:SetTexCoord (6/256, 38/256, 49/128, 81/128)
spellIconBorder:SetTexCoord(6/256, 38/256, 49/128, 81/128)
spellIconBorder:SetSize(20, 20)
spellIconBorder:SetPoint("topleft", spellIcon, "topleft", 0, 0)
@@ -96,13 +96,13 @@ local create_deathrecap_line = function(parent, n)
lifeStatusBar:SetColorTexture(0.5, 0.5, 0.5, 0.4)
backgroundTexture:SetTexture([[Interface\AddOns\Details\images\deathrecap_background]])
backgroundTexture:SetTexCoord (0, 1, 0, 1)
backgroundTexture:SetTexCoord(0, 1, 0, 1)
backgroundTexture:SetVertexColor(.1, .1, .1, .3)
--top border
local TopFader = line:CreateTexture(nil, "border")
TopFader:SetTexture([[Interface\AddOns\Details\images\deathrecap_background_top]])
TopFader:SetTexCoord (0, 1, 0, 1)
TopFader:SetTexCoord(0, 1, 0, 1)
TopFader:SetVertexColor(.1, .1, .1, .3)
TopFader:SetPoint("bottomleft", backgroundTexture, "topleft", 0, -0)
TopFader:SetPoint("bottomright", backgroundTexture, "topright", 0, -0)
@@ -114,7 +114,7 @@ local create_deathrecap_line = function(parent, n)
--bottom fader
local backgroundTexture2 = line:CreateTexture(nil, "border")
backgroundTexture2:SetTexture([[Interface\AddOns\Details\images\deathrecap_background_bottom]])
backgroundTexture2:SetTexCoord (0, 1, 0, 1)
backgroundTexture2:SetTexCoord(0, 1, 0, 1)
backgroundTexture2:SetVertexColor(.1, .1, .1, .3)
backgroundTexture2:SetPoint("topleft", backgroundTexture, "bottomleft", 0, 0)
backgroundTexture2:SetPoint("topright", backgroundTexture, "bottomright", 0, 0)
@@ -129,7 +129,7 @@ local create_deathrecap_line = function(parent, n)
backgroundTexture:SetPoint("bottomright", 0, -1)
backgroundTexture:SetDesaturated(true)
backgroundTextureOverlay:SetTexture([[Interface\AdventureMap\AdventureMap]])
backgroundTextureOverlay:SetTexCoord (460/1024, 659/1024, 330/1024, 350/1024)
backgroundTextureOverlay:SetTexCoord(460/1024, 659/1024, 330/1024, 350/1024)
backgroundTextureOverlay:SetAllPoints()
backgroundTextureOverlay:SetDesaturated(true)
backgroundTextureOverlay:SetAlpha(0.5)
@@ -173,7 +173,7 @@ function Details.BuildDeathTableFromRecap (recapID)
{}, --deathlog events
(events [1] and events [1].timestamp) or (DeathRecapFrame and DeathRecapFrame.DeathTimeStamp) or 0, --time of death
UnitName ("player"),
select(2, UnitClass ("player")),
select(2, UnitClass("player")),
UnitHealthMax ("player"),
"0m 0s", --formated fight time
["dead"] = true,
@@ -215,10 +215,10 @@ function Details.GetDeathRecapFromChat()
for i = numLines, 1, -1 do
local text = chat1:GetMessageInfo (i)
if (text) then
if (text:find ("Hdeath:%d")) then
if (text:find("Hdeath:%d")) then
local recapID = text:match ("|Hdeath:(%d+)|h")
if (recapID) then
recapIDFromChat = tonumber (recapID)
recapIDFromChat = tonumber(recapID)
end
break
end
@@ -487,14 +487,14 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
local line = Details.DeathRecap.Lines [lineIndex]
if (line) then
line.timeAt:SetText(format ("%.1f", eventTime - timeOfDeath) .. "s")
line.timeAt:SetText(format("%.1f", eventTime - timeOfDeath) .. "s")
line.spellIcon:SetTexture(spellIcon or customSpellInfo and customSpellInfo [3] or "")
line.TopFader:Hide()
--line.spellIcon:SetTexCoord (.1, .9, .1, .9)
--line.spellIcon:SetTexCoord(.1, .9, .1, .9)
--line.sourceName:SetText("|cFFC6B0D9" .. source .. "|r")
--parse source and cut the length of the string after setting the spellname and source
local sourceClass = Details:GetClass (source)
local sourceClass = Details:GetClass(source)
local sourceSpec = Details:GetSpec (source)
if (not sourceClass) then
@@ -520,7 +520,7 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
--remove real name or owner name
source = Details:GetOnlyName(source)
--remove owner name
source = source:gsub ((" <.*"), "")
source = source:gsub((" <.*"), "")
--if a player?
if (Details.player_class [sourceClass]) then
@@ -534,19 +534,19 @@ function Details.OpenDetailsDeathRecap (segment, RecapID, fromChat)
--remove the dot signal from the spell name
if (not spellName) then
spellName = customSpellInfo and customSpellInfo [2] or "*?*"
if (spellName:find (STRING_ENVIRONMENTAL_DAMAGE_FALLING)) then
if (spellName:find(STRING_ENVIRONMENTAL_DAMAGE_FALLING)) then
if (UnitName ("player") == "Elphaba") then
spellName = "Gravity Won!, Elphaba..."
source = ""
else
source = "Gravity"
end
--/run for a,b in pairs(_G) do if (type(b)=="string" and b:find ("Falling")) then print(a,b) end end
--/run for a,b in pairs(_G) do if (type(b)=="string" and b:find("Falling")) then print(a,b) end end
end
end
spellName = spellName:gsub (L["STRING_DOT"], "")
spellName = spellName:gsub ("[*] ", "")
spellName = spellName:gsub(L["STRING_DOT"], "")
spellName = spellName:gsub("[*] ", "")
source = source or ""
line.sourceName:SetText(spellName .. " (" .. "|cFFC6B0D9" .. source .. "|r" .. ")")
+10 -10
View File
@@ -49,7 +49,7 @@ local addPlayerDamage = function(unitName, unitRealm)
playerData = {
Name = unitName,
ChartData = {max_value = 0},
Class = select(2, UnitClass (CLName)),
Class = select(2, UnitClass(CLName)),
--spec zero for now, need to retrive later during combat
Spec = 0,
@@ -167,7 +167,7 @@ function mythicDungeonCharts:OnBossDefeated()
if (mythicLevel and mythicLevel > 0) then
if (mythicDungeonCharts.ChartTable and mythicDungeonCharts.ChartTable.Running and bossInfo) then
local copiedBossInfo = Details:GetFramework().table.copy ({}, bossInfo)
local copiedBossInfo = Details:GetFramework().table.copy({}, bossInfo)
tinsert(mythicDungeonCharts.ChartTable.BossDefeated, {time() - mythicDungeonCharts.ChartTable.StartTime, copiedBossInfo, currentCombat:GetCombatTime()})
mythicDungeonCharts:Debug("Boss defeated, time saved", currentCombat:GetCombatTime())
else
@@ -177,7 +177,7 @@ function mythicDungeonCharts:OnBossDefeated()
if (mythicDungeonCharts.ChartTable.EndTime + 2 >= now) then
if (bossInfo) then
local copiedBossInfo = Details:GetFramework().table.copy ({}, bossInfo)
local copiedBossInfo = Details:GetFramework().table.copy({}, bossInfo)
tinsert(mythicDungeonCharts.ChartTable.BossDefeated, {time() - mythicDungeonCharts.ChartTable.StartTime, copiedBossInfo, currentCombat:GetCombatTime()})
mythicDungeonCharts:Debug("Boss defeated, time saved, but used time aproximation:", mythicDungeonCharts.ChartTable.EndTime + 2, now, currentCombat:GetCombatTime())
end
@@ -421,12 +421,12 @@ function mythicDungeonCharts.ShowChart()
dungeonChartFrame.BossWidgetsFrame.GraphPin = dungeonChartFrame.BossWidgetsFrame:CreateTexture(nil, "overlay")
dungeonChartFrame.BossWidgetsFrame.GraphPin:SetTexture([[Interface\BUTTONS\UI-RadioButton]])
dungeonChartFrame.BossWidgetsFrame.GraphPin:SetTexCoord (17/64, 32/64, 0, 1)
dungeonChartFrame.BossWidgetsFrame.GraphPin:SetTexCoord(17/64, 32/64, 0, 1)
dungeonChartFrame.BossWidgetsFrame.GraphPin:SetSize(16, 16)
dungeonChartFrame.BossWidgetsFrame.GraphPinGlow = dungeonChartFrame.BossWidgetsFrame:CreateTexture(nil, "artwork")
dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetTexture([[Interface\Calendar\EventNotificationGlow]])
dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetTexCoord (0, 1, 0, 1)
dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetTexCoord(0, 1, 0, 1)
dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetSize(14, 14)
dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetBlendMode("ADD")
dungeonChartFrame.BossWidgetsFrame.GraphPinGlow:SetPoint("center", dungeonChartFrame.BossWidgetsFrame.GraphPin, "center", 0, 0)
@@ -519,12 +519,12 @@ function mythicDungeonCharts.ShowChart()
local leftDivisorLine = dungeonChartFrame.BossWidgetsFrame:CreateTexture(nil, "overlay")
leftDivisorLine:SetSize(2, dungeonChartFrame.ChartFrame.Graphic:GetHeight())
leftDivisorLine:SetColorTexture (1, 1, 1, 1)
leftDivisorLine:SetColorTexture(1, 1, 1, 1)
leftDivisorLine:SetPoint("bottomleft", dungeonChartFrame.ChartFrame.Graphic.TextFrame, "bottomleft", -2, 0)
local bottomDivisorLine = dungeonChartFrame.BossWidgetsFrame:CreateTexture(nil, "overlay")
bottomDivisorLine:SetSize(dungeonChartFrame.ChartFrame.Graphic:GetWidth(), 2)
bottomDivisorLine:SetColorTexture (1, 1, 1, 1)
bottomDivisorLine:SetColorTexture(1, 1, 1, 1)
bottomDivisorLine:SetPoint("bottomleft", dungeonChartFrame.ChartFrame.Graphic.TextFrame, "bottomleft", 0, 0)
dungeonChartFrame.ChartFrame.Graphic:SetBackdrop({edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
@@ -547,7 +547,7 @@ function mythicDungeonCharts.ShowChart()
newBossWidget.AvatarTexture = bossAvatar
local verticalLine = Details:GetFramework():CreateImage(newBossWidget, "", 1, dungeonChartFrame.ChartFrame.Graphic:GetHeight(), "overlay")
verticalLine:SetColorTexture (1, 1, 1, 0.3)
verticalLine:SetColorTexture(1, 1, 1, 0.3)
verticalLine:SetPoint("bottomleft", newBossWidget, "bottomright", 0, 0)
local timeText = Details:GetFramework():CreateLabel(newBossWidget)
@@ -555,7 +555,7 @@ function mythicDungeonCharts.ShowChart()
newBossWidget.TimeText = timeText
local timeBackground = Details:GetFramework():CreateImage(newBossWidget, "", 30, 12, "artwork")
timeBackground:SetColorTexture (0, 0, 0, 0.5)
timeBackground:SetColorTexture(0, 0, 0, 0.5)
timeBackground:SetPoint("topleft", timeText, "topleft", -2, 2)
timeBackground:SetPoint("bottomright", timeText, "bottomright", 2, 0)
@@ -589,7 +589,7 @@ function mythicDungeonCharts.ShowChart()
if (Details.mythic_plus.last_mythicrun_chart) then
--load the last mythic dungeon run chart
local t = {}
Details:GetFramework().table.copy (t, Details.mythic_plus.last_mythicrun_chart)
Details:GetFramework().table.copy(t, Details.mythic_plus.last_mythicrun_chart)
mythicDungeonCharts.ChartTable = t
mythicDungeonCharts:Debug("no valid data, saved data loaded")
+2 -2
View File
@@ -250,7 +250,7 @@ local common_events = {
return
end
local okay, errortext = pcall (func, event, ...)
local okay, errortext = pcall(func, event, ...)
if (not okay) then
--trigger an error msg
@@ -272,7 +272,7 @@ local common_events = {
return
end
local okay, errortext = pcall (func, context, event, ...)
local okay, errortext = pcall(func, context, event, ...)
if (not okay) then
--attempt to get the context name
+1 -1
View File
@@ -603,7 +603,7 @@ function DetailsMythicPlusFrame.MythicDungeonFinished (fromZoneLeft)
--store data
--[=[
local expansion = tostring (select(4, GetBuildInfo())):match ("%d%d")
local expansion = tostring(select(4, GetBuildInfo())):match ("%d%d")
if (expansion and type(expansion) == "string" and string.len(expansion) == 2) then
local expansionDungeonData = _detalhes.dungeon_data [expansion]
if (not expansionDungeonData) then
+2 -2
View File
@@ -401,11 +401,11 @@ function Details.packFunctions.RetriveActorInformation(combatData, index)
local serialNumber = combatData[index + 2]
serialNumber = unpackActorSerial(serialNumber)
--class [4]
--class[4]
local class = combatData[index + 3]
class = unpackActorClass(class)
--spec [5]
--spec[5]
local spec = tonumber(combatData[index + 4])
--return the values
+3 -3
View File
@@ -19,7 +19,7 @@ do
end
function _detalhes:GetIconTexture (iconType, withAlpha)
iconType = string.lower (iconType)
iconType = string.lower(iconType)
if (iconType == "spec") then
if (withAlpha) then
@@ -38,7 +38,7 @@ do
end
-- try get the class from actor name
function _detalhes:GetClass (name)
function _detalhes:GetClass(name)
local _, class = _UnitClass (name)
if (not class) then
@@ -204,7 +204,7 @@ do
return
end
local class = _detalhes:GetClass (Actor.nome)
local class = _detalhes:GetClass(Actor.nome)
if (class and class ~= "UNKNOW") then
Actor.classe = class
Actor.need_refresh = true
+11 -11
View File
@@ -165,7 +165,7 @@ function _detalhes:ResetProfile (profile_name)
end
--reset the profile
table.wipe (profile.instances)
table.wipe(profile.instances)
--export first instance
local instance = _detalhes:GetInstance(1)
@@ -196,7 +196,7 @@ function _detalhes:CreatePanicWarning()
--tinsert(UISpecialFrames, "DetailsPanicWarningFrame")
_detalhes.instance_load_failed.text = _detalhes.instance_load_failed:CreateFontString(nil, "overlay", "GameFontNormal")
_detalhes.instance_load_failed.text:SetPoint("center", _detalhes.instance_load_failed, "center")
_detalhes.instance_load_failed.text:SetTextColor (1, 0.6, 0)
_detalhes.instance_load_failed.text:SetTextColor(1, 0.6, 0)
_detalhes.instance_load_failed:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
_detalhes.instance_load_failed:SetBackdropColor(1, 0, 0, 0.2)
_detalhes.instance_load_failed:SetPoint("topleft", UIParent, "topleft", 0, -250)
@@ -204,7 +204,7 @@ function _detalhes:CreatePanicWarning()
end
local safe_load = function(func, param1, ...)
local okey, errortext = pcall (func, param1, ...)
local okey, errortext = pcall(func, param1, ...)
if (not okey) then
if (not _detalhes.instance_load_failed) then
_detalhes:CreatePanicWarning()
@@ -283,7 +283,7 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy)
--then close all opened instances
for index, instance in _detalhes:ListInstances() do
if (not getmetatable (instance)) then
if (not getmetatable(instance)) then
instance.iniciada = false
setmetatable(instance, _detalhes)
end
@@ -1511,7 +1511,7 @@ function _detalhes:SaveProfileSpecial()
end
--save skins
table.wipe (profile.instances)
table.wipe(profile.instances)
if (_detalhes.tabela_instancias) then
for index, instance in ipairs(_detalhes.tabela_instancias) do
@@ -1686,7 +1686,7 @@ function Details:ExportCurrentProfile()
for key, _ in pairs(defaultPlayerData) do
if (not exportProfileBlacklist[key]) then
if (type(Details[key]) == "table") then
playerData [key] = DetailsFramework.table.copy ({}, Details[key])
playerData [key] = DetailsFramework.table.copy({}, Details[key])
else
playerData [key] = Details[key]
end
@@ -1695,7 +1695,7 @@ function Details:ExportCurrentProfile()
for key, _ in pairs(defaultGlobalData) do
if (not exportProfileBlacklist[key]) then
if (type(Details[key]) == "table") then
globaData [key] = DetailsFramework.table.copy ({}, Details[key])
globaData [key] = DetailsFramework.table.copy({}, Details[key])
else
globaData [key] = Details[key]
end
@@ -1754,7 +1754,7 @@ function Details:ImportProfile (profileString, newProfileName)
local importedValue = playerData[key]
if (importedValue ~= nil) then
if (type(importedValue) == "table") then
Details [key] = DetailsFramework.table.copy ({}, importedValue)
Details [key] = DetailsFramework.table.copy({}, importedValue)
else
Details [key] = importedValue
end
@@ -1765,7 +1765,7 @@ function Details:ImportProfile (profileString, newProfileName)
local importedValue = globalData[key]
if (importedValue ~= nil) then
if (type(importedValue) == "table") then
Details [key] = DetailsFramework.table.copy ({}, importedValue)
Details [key] = DetailsFramework.table.copy({}, importedValue)
else
Details [key] = importedValue
end
@@ -1777,7 +1777,7 @@ function Details:ImportProfile (profileString, newProfileName)
local importedValue = profileData[key]
if (importedValue ~= nil) then
if (type(importedValue) == "table") then
profileObject [key] = DetailsFramework.table.copy ({}, importedValue)
profileObject [key] = DetailsFramework.table.copy({}, importedValue)
else
profileObject [key] = importedValue
end
@@ -1804,7 +1804,7 @@ function Details:ImportProfile (profileString, newProfileName)
Details.segments_amount_to_save = 40
--transfer instance data to the new created profile
profileObject.instances = DetailsFramework.table.copy ({}, profileData.instances)
profileObject.instances = DetailsFramework.table.copy({}, profileData.instances)
Details:ApplyProfile (newProfileName)
+1 -1
View File
@@ -1055,7 +1055,7 @@ local _
end
table.wipe (instance1.snap); table.wipe (instance2.snap)
table.wipe(instance1.snap); table.wipe(instance2.snap)
instance1.snap [3] = 2; instance2.snap [1] = 1;
instance1.horizontalSnap = true; instance2.horizontalSnap = true
+34 -34
View File
@@ -23,7 +23,7 @@ SLASH_DETAILS1, SLASH_DETAILS2, SLASH_DETAILS3 = "/details", "/dt", "/de"
function SlashCmdList.DETAILS (msg, editbox)
local command, rest = msg:match("^(%S*)%s*(.-)$")
command = string.lower (command)
command = string.lower(command)
if (command == Loc ["STRING_SLASH_WIPE"] or command == "wipe") then
@@ -41,7 +41,7 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (command == Loc ["STRING_SLASH_TOGGLE"] or command == "toggle") then
local instance = rest:match ("^(%S*)%s*(.-)$")
instance = tonumber (instance)
instance = tonumber(instance)
if (instance) then
_detalhes:ToggleWindow (instance)
else
@@ -51,7 +51,7 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (command == Loc ["STRING_SLASH_HIDE"] or command == Loc ["STRING_SLASH_HIDE_ALIAS1"] or command == "hide") then
local instance = rest:match ("^(%S*)%s*(.-)$")
instance = tonumber (instance)
instance = tonumber(instance)
if (instance) then
local this_instance = _detalhes:GetInstance(instance)
if (not this_instance) then
@@ -130,7 +130,7 @@ function SlashCmdList.DETAILS (msg, editbox)
_detalhes.LastShowCommand = GetTime()
local instance = rest:match ("^(%S*)%s*(.-)$")
instance = tonumber (instance)
instance = tonumber(instance)
if (instance) then
local this_instance = _detalhes:GetInstance(instance)
if (not this_instance) then
@@ -173,8 +173,8 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (command == Loc ["STRING_SLASH_OPTIONS"] or command == "options" or command == "config") then
if (rest and tonumber (rest)) then
local instanceN = tonumber (rest)
if (rest and tonumber(rest)) then
local instanceN = tonumber(rest)
if (instanceN > 0 and instanceN <= #_detalhes.tabela_instancias) then
local instance = _detalhes:GetInstance(instanceN)
_detalhes:OpenOptionsWindow (instance)
@@ -195,7 +195,7 @@ function SlashCmdList.DETAILS (msg, editbox)
local questIds = {{"Tarlna the Ageless", 81535}, {"Drov the Ruiner ", 87437}, {"Rukhmar", 87493}}
for _, _table in pairs(questIds) do
print(format ("%s: \124cff%s\124r", _table [1], IsQuestFlaggedCompleted (_table [2]) and "ff0000"..Loc ["STRING_KILLED"] or "00ff00"..Loc ["STRING_ALIVE"]))
print(format("%s: \124cff%s\124r", _table [1], IsQuestFlaggedCompleted (_table [2]) and "ff0000"..Loc ["STRING_KILLED"] or "00ff00"..Loc ["STRING_ALIVE"]))
end
elseif (command == Loc ["STRING_SLASH_CHANGES"] or command == Loc ["STRING_SLASH_CHANGES_ALIAS1"] or command == Loc ["STRING_SLASH_CHANGES_ALIAS2"] or command == "news" or command == "updates") then
@@ -324,7 +324,7 @@ function SlashCmdList.DETAILS (msg, editbox)
A:Play()
C_Timer.NewTicker(1, function()
texture:SetTexCoord (math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random())
texture:SetTexCoord(math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random(), math.random())
end)
@@ -517,7 +517,7 @@ function SlashCmdList.DETAILS (msg, editbox)
for i = 1, 10000 do
a [i] = {math.random (50000)}
end
table.wipe (a)
table.wipe(a)
elseif (msg == "unitname") then
@@ -631,7 +631,7 @@ function SlashCmdList.DETAILS (msg, editbox)
scanTool:ClearLines()
print(petName)
scanTool:SetUnit (petName)
scanTool:SetUnit(petName)
local ownerText = scanText:GetText()
if (not ownerText) then
@@ -649,7 +649,7 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (command == "buffsof") then
local playername, segment = rest:match("^(%S*)%s*(.-)$")
segment = tonumber (segment or 0)
segment = tonumber(segment or 0)
print("dumping buffs of ", playername, segment)
local c = _detalhes:GetCombat("current")
@@ -727,7 +727,7 @@ function SlashCmdList.DETAILS (msg, editbox)
--debug
elseif (command == "barra") then
local whichRowLine = rest and tonumber (rest) or 1
local whichRowLine = rest and tonumber(rest) or 1
local instancia = _detalhes.tabela_instancias [1]
local barra = instancia.barras [whichRowLine]
@@ -758,7 +758,7 @@ function SlashCmdList.DETAILS (msg, editbox)
print(g)
print(string.len(g))
local serial = g:sub (12, 18)
serial = tonumber ("0x"..serial)
serial = tonumber("0x"..serial)
print(serial)
--tonumber((UnitGUID("target")):sub(-12, -9), 16))
@@ -788,7 +788,7 @@ function SlashCmdList.DETAILS (msg, editbox)
Details.id_frame.texto = CreateFrame("editbox", nil, Details.id_frame, "BackdropTemplate")
Details.id_frame.texto:SetPoint("topleft", Details.id_frame, "topleft")
Details.id_frame.texto:SetAutoFocus(false)
Details.id_frame.texto:SetFontObject (GameFontHighlightSmall)
Details.id_frame.texto:SetFontObject(GameFontHighlightSmall)
Details.id_frame.texto:SetHeight(14)
Details.id_frame.texto:SetWidth(120)
Details.id_frame.texto:SetJustifyH("CENTER")
@@ -844,7 +844,7 @@ function SlashCmdList.DETAILS (msg, editbox)
_detalhes.id_frame.texto = CreateFrame("editbox", nil, _detalhes.id_frame)
_detalhes.id_frame.texto:SetPoint("topleft", _detalhes.id_frame, "topleft")
_detalhes.id_frame.texto:SetAutoFocus(false)
_detalhes.id_frame.texto:SetFontObject (GameFontHighlightSmall)
_detalhes.id_frame.texto:SetFontObject(GameFontHighlightSmall)
_detalhes.id_frame.texto:SetHeight(14)
_detalhes.id_frame.texto:SetWidth(120)
_detalhes.id_frame.texto:SetJustifyH("CENTER")
@@ -879,8 +879,8 @@ function SlashCmdList.DETAILS (msg, editbox)
end
else
print(pass_guid.. " -> " .. tonumber (pass_guid:sub(6, 10), 16))
_detalhes.id_frame.texto:SetText(""..tonumber (pass_guid:sub(6, 10), 16))
print(pass_guid.. " -> " .. tonumber(pass_guid:sub(6, 10), 16))
_detalhes.id_frame.texto:SetText(""..tonumber(pass_guid:sub(6, 10), 16))
_detalhes.id_frame.texto:HighlightText()
end
@@ -931,7 +931,7 @@ function SlashCmdList.DETAILS (msg, editbox)
elseif (command == "names") then
local t, filter = rest:match("^(%S*)%s*(.-)$")
t = tonumber (t)
t = tonumber(t)
if (not t) then
return print("not T found.")
end
@@ -957,7 +957,7 @@ function SlashCmdList.DETAILS (msg, editbox)
local t, filter = rest:match("^(%S*)%s*(.-)$")
t = tonumber (t)
t = tonumber(t)
if (not t) then
return print("not T found.")
end
@@ -1073,7 +1073,7 @@ function SlashCmdList.DETAILS (msg, editbox)
local x, y = GetPlayerMapPosition ("player")
if (not DetailsPosBox) then
_detalhes.gump:CreateTextEntry (UIParent, function()end, 200, 20, nil, "DetailsPosBox")
_detalhes.gump:CreateTextEntry(UIParent, function()end, 200, 20, nil, "DetailsPosBox")
DetailsPosBox:SetPoint("center", UIParent, "center")
end
@@ -1309,7 +1309,7 @@ function SlashCmdList.DETAILS (msg, editbox)
--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]))
--texture:SetTexCoord(unpack(_detalhes.class_specs_coords [spec]))
--a:SetAlpha(abs(math.sin (time)))
--a:SetValue(abs(math.sin (time)))
@@ -1362,7 +1362,7 @@ function SlashCmdList.DETAILS (msg, editbox)
local spec = DetailsFramework.GetSpecialization()
if (spec) then
local specID = DetailsFramework.GetSpecializationInfo (spec)
local specID = DetailsFramework.GetSpecializationInfo(spec)
if (specID and specID ~= 0) then
print("Current SpecID: ", specID)
end
@@ -1612,7 +1612,7 @@ function SlashCmdList.DETAILS (msg, editbox)
local keys = {}
--copy from table2 to table1 overwriting values
function f.copy (t1, t2)
function f.copy(t1, t2)
if (t1.Timer) then
t1, t2 = t1.t1, t1.t2
end
@@ -1632,7 +1632,7 @@ function SlashCmdList.DETAILS (msg, editbox)
keys [key] = true
f.copy (t1 [key], t2 [key])
f.copy(t1 [key], t2 [key])
else
t1 [key] = value
end
@@ -1641,8 +1641,8 @@ function SlashCmdList.DETAILS (msg, editbox)
return t1
end
--local copySegment = f.copy ({}, _detalhes.tabela_vigente)
local copySegment = f.copy ({}, _detalhes.tabela_historico.tabelas [2])
--local copySegment = f.copy({}, _detalhes.tabela_vigente)
local copySegment = f.copy({}, _detalhes.tabela_historico.tabelas [2])
--the segment received is raw and does not have metatables, need to refresh them
local zipData = Details:CompressData (copySegment, "print")
@@ -1664,7 +1664,7 @@ function SlashCmdList.DETAILS (msg, editbox)
--attempt to cast the passed value to the same value as the type in the profile
if (whichType == "number") then
rest = tonumber (rest)
rest = tonumber(rest)
if (rest) then
_detalhes [command] = rest
print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to " .. rest)
@@ -1673,7 +1673,7 @@ function SlashCmdList.DETAILS (msg, editbox)
end
elseif (whichType == "string") then
rest = tostring (rest)
rest = tostring(rest)
if (rest) then
_detalhes [command] = rest
print(Loc ["STRING_DETAILS1"] .. "config '" .. command .. "' set to " .. rest)
@@ -1727,7 +1727,7 @@ function Details.RefreshUserList (ignoreIfHidden)
return
end
local newList = DetailsFramework.table.copy ({}, _detalhes.users or {})
local newList = DetailsFramework.table.copy({}, _detalhes.users or {})
table.sort (newList, function(t1, t2)
return t1[3] > t2[3]
@@ -1740,7 +1740,7 @@ function Details.RefreshUserList (ignoreIfHidden)
local foundPlayer
for o = 1, #newList do
if (newList[o][1]:find (playerName)) then
if (newList[o][1]:find(playerName)) then
foundPlayer = true
break
end
@@ -1845,7 +1845,7 @@ function Details:UpdateUserPanel (usersTable)
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
line:SetBackdropColor(unpack(backdrop_color))
DetailsFramework:Mixin (line, DetailsFramework.HeaderFunctions)
DetailsFramework:Mixin(line, DetailsFramework.HeaderFunctions)
line:SetScript("OnEnter", lineOnEnter)
line:SetScript("OnLeave", lineOnLeave)
@@ -1949,10 +1949,10 @@ function _detalhes:CreateListPanel()
row.text:SetPoint("topleft", _detalhes.ListPanel.container, "topleft", 0, -index * 15)
end
if (filter and text:find (filter)) then
row.text:SetTextColor (1, 1, 0)
if (filter and text:find(filter)) then
row.text:SetTextColor(1, 1, 0)
else
row.text:SetTextColor (1, 1, 1)
row.text:SetTextColor(1, 1, 1)
end
row.text:SetText(text)
+32 -3
View File
@@ -428,10 +428,13 @@ do
--Devastation Evoker:
[368847] = 1467, --Firestorm
[369374] = 1467, --Firestorm
[370452] = 1467, --Shattering Star
[375087] = 1467, --Dragonrage
[359073] = 1467, --Eternity Surge
[359077] = 1467, --Eternity Surge
[357211] = 1467, --Pyre
[357212] = 1467, --Pyre
--Preservation Evoker:
[370960] = 1468, --Emerald Communion
@@ -2960,8 +2963,34 @@ do
[20243] = "WARRIOR", --devastate
[115767] = "WARRIOR", --deep wounds
[109128] = "WARRIOR", --charge
[109128] = "WARRIOR", --charge
[12880] = "WARRIOR", --enrage
--evoker:
[368847] = "EVOKER", --Firestorm
[370452] = "EVOKER", --Shattering Star
[375087] = "EVOKER", --Dragonrage
[359073] = "EVOKER", --Eternity Surge
[369374] = "EVOKER", --Firestorm
[357211] = "EVOKER", --Pyre
[357212] = "EVOKER", --Pyre
[370960] = "EVOKER", --Emerald Communion
[370537] = "EVOKER", --Stasis
[367226] = "EVOKER", --Spiritbloom
[361178] = "EVOKER", --Mass Return
[359816] = "EVOKER", --Dream Flight
[355936] = "EVOKER", --Dream Breath
[357170] = "EVOKER", --Time Dilation
[363534] = "EVOKER", --Rewind
[360823] = "EVOKER", --Naturalize
[373861] = "EVOKER", --Temporal Anomaly
[366155] = "EVOKER", --Reversion
[364343] = "EVOKER", --Echo
[356995] = "EVOKER", --Desintegrate
[357209] = "EVOKER", --Fire Breath
[359077] = "EVOKER", --Eternity Surge
[361500] = "EVOKER", --Living Flame
[353759] = "EVOKER", --Deep Breath
[387036] = "EVOKER", --Burning Embers
}
_detalhes.AbsorbSpells = {
@@ -3949,11 +3978,11 @@ do
return _detalhes.spells_school [school] and _detalhes.spells_school [school].formated or ""
end
local default_school_color = {145/255, 180/255, 228/255}
function _detalhes:GetSpellSchoolColor (school)
function _detalhes:GetSpellSchoolColor(school)
return unpack(_detalhes.spells_school [school] and _detalhes.spells_school [school].decimals or default_school_color)
end
function _detalhes:GetCooldownList (class)
class = class or select(2, UnitClass ("player"))
class = class or select(2, UnitClass("player"))
return _detalhes.DefensiveCooldownSpells [class]
end
end
+1 -1
View File
@@ -31,7 +31,7 @@ end
function Details:CreateTestBars (alphabet, isArena)
local current_combat = Details:GetCombat("current")
local pclass = select(2, UnitClass ("player"))
local pclass = select(2, UnitClass("player"))
local actors_name = {
{"Spiro", "EVOKER", 1467},
+11 -11
View File
@@ -502,17 +502,17 @@
return
end
text = text:gsub ("{dmg}", get_player_damage)
text = text:gsub ("{rdps}", get_raid_dps)
text = text:gsub ("{rhps}", get_raid_hps)
text = text:gsub ("{dps}", get_player_dps)
text = text:gsub ("{heal}", get_player_heal)
text = text:gsub ("{hps}", get_player_hps)
text = text:gsub ("{time}", get_combat_time)
text = text:gsub ("{dpos}", get_damage_position)
text = text:gsub ("{hpos}", get_heal_position)
text = text:gsub ("{ddiff}", get_damage_diff)
text = text:gsub ("{hdiff}", get_heal_diff)
text = text:gsub("{dmg}", get_player_damage)
text = text:gsub("{rdps}", get_raid_dps)
text = text:gsub("{rhps}", get_raid_hps)
text = text:gsub("{dps}", get_player_dps)
text = text:gsub("{heal}", get_player_heal)
text = text:gsub("{hps}", get_player_hps)
text = text:gsub("{time}", get_combat_time)
text = text:gsub("{dpos}", get_damage_position)
text = text:gsub("{hpos}", get_heal_position)
text = text:gsub("{ddiff}", get_damage_diff)
text = text:gsub("{hdiff}", get_heal_diff)
return text
end
@@ -26,7 +26,7 @@ f:SetScript("OnEvent", function(self, event, addonName)
if (DetailsDataStorage.VERSION < DETAILS_STORAGE_VERSION) then
--do revisions
if (DetailsDataStorage.VERSION < 5) then
table.wipe (DetailsDataStorage)
table.wipe(DetailsDataStorage)
DetailsDataStorage = _detalhes:CreateStorageDB()
end
end
@@ -227,7 +227,7 @@ local function CreatePluginFrames (data)
end
--wipe emotes
table.wipe (EncounterDetails.boss_emotes_table)
table.wipe(EncounterDetails.boss_emotes_table)
elseif (event == "GROUP_ONENTER") then
if (EncounterDetails.db.show_icon == 2) then
@@ -318,7 +318,7 @@ local function CreatePluginFrames (data)
if (_G.DBM) then
local dbm_timer_callback = function(bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid)
--print(bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid)
local spell = tostring (spellId)
local spell = tostring(spellId)
if (spell and not current_table_dbm [spell]) then
current_table_dbm [spell] = {spell, id, msg, timer, icon, bartype, spellId, colorId, modid}
end
@@ -329,7 +329,7 @@ local function CreatePluginFrames (data)
if (BigWigsLoader) then
function EncounterDetails:BigWigs_StartBar (event, module, spellid, bar_text, time, icon, ...)
--print(event, module, spellid, bar_text, time, icon, ...)
spellid = tostring (spellid)
spellid = tostring(spellid)
if (not current_table_bigwigs [spellid]) then
current_table_bigwigs [spellid] = {(type(module) == "string" and module) or (module and module.moduleName) or "", spellid or "", bar_text or "", time or 0, icon or ""}
end
@@ -656,8 +656,8 @@ end
overkill = ""
end
if (source:find ("%[")) then
source = source:gsub ("%[%*%] ", "")
if (source:find("%[")) then
source = source:gsub("%[%*%] ", "")
end
GameCooltip:AddLine("" .. _cstr ("%.1f", timeInSeconds - hora_da_morte) .. "s " .. spellname .. " (" .. source .. ")", "-" .. _detalhes:ToK (amount) .. overkill .. " (" .. hp .. "%)", 1, "white", "white")
@@ -672,7 +672,7 @@ end
end
else
--heal
local class = Details:GetClass (source)
local class = Details:GetClass(source)
local spec = Details:GetSpec (source)
GameCooltip:AddLine("" .. _cstr ("%.1f", timeInSeconds - hora_da_morte) .. "s " .. spellname .. " (" .. Details:GetOnlyName(Details:AddClassOrSpecIcon (source, class, spec, 16, true)) .. ")", "+" .. _detalhes:ToK (amount) .. " (" .. hp .. "%)", 1, "white", "white")
@@ -697,8 +697,8 @@ end
elseif (evtype == 4) then
--debuff
if (source:find ("%[")) then
source = source:gsub ("%[%*%] ", "")
if (source:find("%[")) then
source = source:gsub("%[%*%] ", "")
end
GameCooltip:AddLine("" .. _cstr ("%.1f", timeInSeconds - hora_da_morte) .. "s [x" .. amount .. "] " .. spellname .. " (" .. source .. ")", "debuff (" .. hp .. "%)", 1, "white", "white")
@@ -856,10 +856,10 @@ local function EnemySkills (habilidade, barra)
for index, tabela in ipairs(tabela_jogadores) do
local coords = EncounterDetails.class_coords [tabela[3]]
GameCooltip:AddLine(EncounterDetails:GetOnlyName(tabela[1]), ToK (_, tabela[2]) .. " (" .. format ("%.1f", tabela[2] / total * 100) .. "%)", 1, "white")
GameCooltip:AddLine(EncounterDetails:GetOnlyName(tabela[1]), ToK (_, tabela[2]) .. " (" .. format("%.1f", tabela[2] / total * 100) .. "%)", 1, "white")
local r, g, b, a = unpack(_detalhes.tooltip.background)
local actorClass = Details:GetClass (tabela[1])
local actorClass = Details:GetClass(tabela[1])
if (actorClass) then
local r, g, b = Details:GetClassColor (actorClass)
GameCooltip:AddStatusBar (tabela[2] / topValue * 100, 1, r, g, b, EncounterDetailsFrame.CooltipStatusbarAlpha, false, {value = 100, color = {.21, .21, .21, 0.5}, texture = [[Interface\AddOns\Details\images\bar_serenity]]})
@@ -979,7 +979,7 @@ function _detalhes:BossInfoRowClick (barra, param1)
local texto_left, texto_right = GameCooltip:GetText (i)
if (texto_left and texto_right) then
texto_left = texto_left:gsub (("|T(.*)|t "), "")
texto_left = texto_left:gsub(("|T(.*)|t "), "")
reportar [#reportar+1] = ""..texto_left.." "..texto_right..""
end
end
@@ -999,7 +999,7 @@ function _detalhes:BossInfoRowClick (barra, param1)
texto_right = texto_right:GetText()
if (texto_left and texto_right) then
texto_left = texto_left:gsub (("|T(.*)|t "), "")
texto_left = texto_left:gsub(("|T(.*)|t "), "")
reportar [#reportar+1] = ""..texto_left.." "..texto_right..""
end
end
@@ -1254,20 +1254,20 @@ function EncounterDetails:OpenAndRefresh (_, segment)
if (L) then
EncounterDetailsFrame.boss_icone:SetTexture(Texture)
EncounterDetailsFrame.boss_icone:SetTexCoord (L, R, T, B)
EncounterDetailsFrame.boss_icone:SetTexCoord(L, R, T, B)
else
EncounterDetailsFrame.boss_icone:SetTexture([[Interface\CHARACTERFRAME\TempPortrait]])
EncounterDetailsFrame.boss_icone:SetTexCoord (0, 1, 0, 1)
EncounterDetailsFrame.boss_icone:SetTexCoord(0, 1, 0, 1)
end
--[=[
local file, L, R, T, B = EncounterDetails:GetRaidBackground (_combat_object.is_boss.mapid)
if (file) then
EncounterDetailsFrame.raidbackground:SetTexture(file)
EncounterDetailsFrame.raidbackground:SetTexCoord (L, R, T, B)
EncounterDetailsFrame.raidbackground:SetTexCoord(L, R, T, B)
else
EncounterDetailsFrame.raidbackground:SetTexture([[Interface\Glues\LOADINGSCREENS\LoadScreenDungeon]])
EncounterDetailsFrame.raidbackground:SetTexCoord (0, 1, 120/512, 408/512)
EncounterDetailsFrame.raidbackground:SetTexCoord(0, 1, 120/512, 408/512)
end
--]=]
@@ -1306,8 +1306,8 @@ function EncounterDetails:OpenAndRefresh (_, segment)
barra.report_text = Loc ["STRING_PLUGIN_NAME"].."! "..Loc ["STRING_DAMAGE_TAKEN_REPORT"]
end
if (jogador.nome:find ("-")) then
barra.lineText1:SetText(jogador.nome:gsub (("-.*"), ""))
if (jogador.nome:find("-")) then
barra.lineText1:SetText(jogador.nome:gsub(("-.*"), ""))
else
barra.lineText1:SetText(jogador.nome)
end
@@ -1318,7 +1318,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
barra.jogador = jogador
barra.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [jogador.classe]))
barra.textura:SetStatusBarColor(_unpack(_detalhes.class_colors [jogador.classe]))
if (index == 1) then
barra.textura:SetValue(100)
@@ -1331,11 +1331,11 @@ function EncounterDetails:OpenAndRefresh (_, segment)
if (specID) then
local texture, l, r, t, b = Details:GetSpecIcon (specID, false)
barra.icone:SetTexture(texture)
barra.icone:SetTexCoord (l, r, t, b)
barra.icone:SetTexCoord(l, r, t, b)
else
barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small")
if (EncounterDetails.class_coords [jogador.classe]) then
barra.icone:SetTexCoord (_unpack(EncounterDetails.class_coords [jogador.classe]))
barra.icone:SetTexCoord(_unpack(EncounterDetails.class_coords [jogador.classe]))
end
end
@@ -1535,7 +1535,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
barra.jogador = habilidade --barra.jogador agora tem a tabela com --[1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia
local spellSchool = _detalhes.spell_school_cache [nome_magia] or 1
local r, g, b = _detalhes:GetSpellSchoolColor (spellSchool)
local r, g, b = _detalhes:GetSpellSchoolColor(spellSchool)
barra.t:SetVertexColor(r, g, b)
@@ -1547,7 +1547,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
end
barra.icone:SetTexture(icone_magia)
barra.icone:SetTexCoord (.1, .9, .1, .9)
barra.icone:SetTexCoord(.1, .9, .1, .9)
barra:Show()
quantidade = quantidade + 1
@@ -1601,7 +1601,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
local nome = jogador.nome
if (not nome:find ("%*")) then
if (not nome:find("%*")) then
local tabela = {nome = nome, total = 0, dano_em = {}, dano_em_total = 0, damage_from = {}, damage_from_total = 0}
--total de dano que ele causou
@@ -1673,7 +1673,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, EncounterDetails.CooltipLineHeight, EncounterDetails.CooltipLineHeight, (coords[1]), (coords[2]), (coords[3]), (coords[4]))
end
local actorClass = Details:GetClass (esta_tabela[1])
local actorClass = Details:GetClass(esta_tabela[1])
if (actorClass) then
local r, g, b = Details:GetClassColor (actorClass)
GameCooltip:AddStatusBar (esta_tabela[2] / topDamage * 100, 1, r, g, b, EncounterDetailsFrame.CooltipStatusbarAlpha, false, {value = 100, color = {.21, .21, .21, 0.5}, texture = [[Interface\AddOns\Details\images\bar_serenity]]})
@@ -1722,7 +1722,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, EncounterDetails.CooltipLineHeight, EncounterDetails.CooltipLineHeight, (coords[1]), (coords[2]), (coords[3]), (coords[4]))
end
local actorClass = Details:GetClass (esta_tabela[1])
local actorClass = Details:GetClass(esta_tabela[1])
if (actorClass) then
local r, g, b = Details:GetClassColor (actorClass)
GameCooltip:AddStatusBar (esta_tabela[2] / topDamage * 100, 1, r, g, b, EncounterDetailsFrame.CooltipStatusbarAlpha, false, {value = 100, color = {.21, .21, .21, 0.5}, texture = [[Interface\AddOns\Details\images\bar_serenity]]})
@@ -1822,8 +1822,8 @@ function EncounterDetails:OpenAndRefresh (_, segment)
barra.jogador = esta_tabela --barra.jogador agora tem a tabela com --[1] total dano causado [2] jogadores que foram alvos [3] jogadores que castaram essa magia [4] ID da magia
--barra.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [jogador.classe]))
barra.textura:SetStatusBarColor (1, 1, 1, 1) --a cor pode ser a spell school da magia
--barra.textura:SetStatusBarColor(_unpack(_detalhes.class_colors [jogador.classe]))
barra.textura:SetStatusBarColor(1, 1, 1, 1) --a cor pode ser a spell school da magia
barra.textura:SetValue(100)
barra:Show()
@@ -1923,7 +1923,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
barra.jogador = tabela
--barra.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [jogador.classe]))
--barra.textura:SetStatusBarColor(_unpack(_detalhes.class_colors [jogador.classe]))
if (index == 1) then
barra.textura:SetValue(100)
@@ -1933,7 +1933,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
end
barra.icone:SetTexture(icone_magia)
barra.icone:SetTexCoord (.1, .9, .1, .9)
barra.icone:SetTexCoord(.1, .9, .1, .9)
barra:Show()
@@ -2026,7 +2026,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
barra.jogador = tabela
--barra.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [jogador.classe]))
--barra.textura:SetStatusBarColor(_unpack(_detalhes.class_colors [jogador.classe]))
if (index == 1) then
barra.textura:SetValue(100)
@@ -2036,7 +2036,7 @@ function EncounterDetails:OpenAndRefresh (_, segment)
end
barra.icone:SetTexture(icone_magia)
barra.icone:SetTexCoord (.1, .9, .1, .9)
barra.icone:SetTexCoord(.1, .9, .1, .9)
barra:Show()
@@ -2078,14 +2078,14 @@ function EncounterDetails:OpenAndRefresh (_, segment)
local overlayTexture = barra:CreateTexture(nil, "overlay")
overlayTexture:SetAllPoints()
overlayTexture:SetColorTexture (1, 1, 1)
overlayTexture:SetColorTexture(1, 1, 1)
overlayTexture:SetAlpha(1)
overlayTexture:Hide()
barra.OverlayTexture = overlayTexture
end
if (tabela [3]:find ("-")) then
barra.lineText1:SetText(index..". "..tabela [3]:gsub (("-.*"), ""))
if (tabela [3]:find("-")) then
barra.lineText1:SetText(index..". "..tabela [3]:gsub(("-.*"), ""))
else
barra.lineText1:SetText(index..". "..tabela [3])
end
@@ -2097,11 +2097,11 @@ function EncounterDetails:OpenAndRefresh (_, segment)
barra.jogador = tabela
barra.extra = habilidades_info
barra.textura:SetStatusBarColor (_unpack(_detalhes.class_colors [tabela [4]]))
barra.textura:SetStatusBarColor(_unpack(_detalhes.class_colors [tabela [4]]))
barra.textura:SetValue(100)
barra.icone:SetTexture("Interface\\AddOns\\Details\\images\\classes_small")
barra.icone:SetTexCoord (_unpack(EncounterDetails.class_coords [tabela [4]]))
barra.icone:SetTexCoord(_unpack(EncounterDetails.class_coords [tabela [4]]))
barra:Show()
+53 -53
View File
@@ -186,18 +186,18 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
row.t = t
row.textura:SetStatusBarTexture (t)
row.textura:SetStatusBarColor (.5, .5, .5, 0)
row.textura:SetStatusBarColor(.5, .5, .5, 0)
row.textura:SetMinMaxValues(0,100)
row.lineText1 = row.textura:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
row.lineText1:SetPoint("LEFT", row.textura, "LEFT", 22, -1)
row.lineText1:SetJustifyH("LEFT")
row.lineText1:SetTextColor (1,1,1,1)
row.lineText1:SetTextColor(1,1,1,1)
row.lineText4 = row.textura:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
row.lineText4:SetPoint("RIGHT", row.textura, "RIGHT", -2, 0)
row.lineText4:SetJustifyH("RIGHT")
row.lineText4:SetTextColor (1,1,1,1)
row.lineText4:SetTextColor(1,1,1,1)
row.textura:Show()
end
@@ -507,7 +507,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
--time of death and player name
GameCooltip:AddLine(vRowFrame.dead[6].." "..vRowFrame.dead[3])
local class, l, r, t, b = _detalhes:GetClass (vRowFrame.dead[3])
local class, l, r, t, b = _detalhes:GetClass(vRowFrame.dead[3])
if (class) then
GameCooltip:AddIcon ([[Interface\AddOns\Details\images\classes_small]], 1, 1, 12, 12, l, r, t, b)
end
@@ -552,7 +552,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
vRowFrame.icon = vRowFrame:CreateTexture(nil, "overlay")
vRowFrame.icon:SetTexture("Interface\\WorldStateFrame\\SkullBones")
vRowFrame.icon:SetTexCoord (0.046875, 0.453125, 0.046875, 0.46875)
vRowFrame.icon:SetTexCoord(0.046875, 0.453125, 0.046875, 0.46875)
vRowFrame.icon:SetWidth(16)
vRowFrame.icon:SetHeight(16)
vRowFrame.icon:SetPoint("center", "DetailsEncountersVerticalLine"..i, "center")
@@ -762,7 +762,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
dlabel.lefttext.text = EncounterDetails:GetOnlyName(player [1])
dlabel.righttext.text = _detalhes:ToK (_math_floor(player [2]))
local class = EncounterDetails:GetClass (player [1])
local class = EncounterDetails:GetClass(player [1])
local spec = EncounterDetails:GetSpec (player [1])
if (spec) then
@@ -775,7 +775,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
else
dlabel.icon.texture = [[Interface\LFGFRAME\LFGROLE_BW]]
dlabel.icon:SetTexCoord (.25, .5, 0, 1)
dlabel.icon:SetTexCoord(.25, .5, 0, 1)
end
dlabel.lefttext:Show()
@@ -799,13 +799,13 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
hlabel.lefttext.text = EncounterDetails:GetOnlyName(player [1])
hlabel.righttext.text = _detalhes:ToK (_math_floor(player [2]))
local classe = _detalhes:GetClass (player [1])
local classe = _detalhes:GetClass(player [1])
if (classe) then
hlabel.icon:SetTexture([[Interface\AddOns\Details\images\classes_small_alpha]])
hlabel.icon:SetTexCoord (unpack(_detalhes.class_coords [classe]))
hlabel.icon:SetTexCoord(unpack(_detalhes.class_coords [classe]))
else
hlabel.icon:SetTexture([[Interface\LFGFRAME\LFGROLE_BW]])
hlabel.icon:SetTexCoord (.25, .5, 0, 1)
hlabel.icon:SetTexCoord(.25, .5, 0, 1)
end
hlabel.lefttext:Show()
@@ -831,8 +831,8 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
end
local phase_on_leave = function(self)
table.wipe (self.damage_actors)
table.wipe (self.heal_actors)
table.wipe(self.damage_actors)
table.wipe(self.heal_actors)
for _, f in ipairs(g.PhaseTextures) do
f.texture:SetBlendMode("BLEND")
@@ -896,7 +896,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
local t = f:CreateTexture(nil, "artwork")
t:SetAllPoints()
t:SetColorTexture (1, 1, 1, phase_alpha)
t:SetColorTexture(1, 1, 1, phase_alpha)
t.original_color = {1, 1, 1}
f.texture = t
@@ -970,7 +970,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
--create lines for damage and time
for i = 1, 8, 1 do
local line = g:CreateTexture(nil, "overlay")
line:SetColorTexture (unpack(CONST_DAMAGE_LINES_COLOR))
line:SetColorTexture(unpack(CONST_DAMAGE_LINES_COLOR))
line:SetWidth(CONST_CHART_WIDTH)
line:SetHeight(1)
@@ -993,7 +993,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
texture:SetWidth(9)
texture:SetHeight(9)
texture:SetPoint("TOPLEFT", EncounterDetails.Frame, "TOPLEFT", (i*65) + 499, -81)
texture:SetColorTexture (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")
@@ -1011,7 +1011,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
v:SetHeight(CONST_CHART_HEIGHT + 1)
v:SetPoint("top", g, "top", 0, 1)
v:SetPoint("left", g, "left", CONST_CHART_DAMAGELINE_X_POSITION + 30, 0) --leave 30 pixels for the damage text
v:SetColorTexture (1, 1, 1, 1)
v:SetColorTexture(1, 1, 1, 1)
--horizontal line at the bottom side
local h = g:CreateTexture(nil, "overlay")
@@ -1019,7 +1019,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
h:SetHeight(1)
h:SetPoint("top", g, "top", 0, -CONST_CHART_HEIGHT + CONST_PHASE_BAR_HEIGHT*2)
h:SetPoint("left", g, "left")
h:SetColorTexture (1, 1, 1, 1)
h:SetColorTexture(1, 1, 1, 1)
end
-- ~start ~main ~frame ~baseframe ~bossframe
@@ -1063,7 +1063,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
local name_bg_texture = BossFrame:CreateTexture(nil, "background")
name_bg_texture:SetTexture([[Interface\PetBattles\_PetBattleHorizTile]], true)
name_bg_texture:SetHorizTile(true)
name_bg_texture:SetTexCoord (0, 1, 126/256, 19/256)
name_bg_texture:SetTexCoord(0, 1, 126/256, 19/256)
name_bg_texture:SetPoint("topleft", BossFrame, "topleft", 2, -22)
name_bg_texture:SetPoint("bottomright", BossFrame, "bottomright")
name_bg_texture:SetHeight(54)
@@ -1126,7 +1126,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
BossFrame.raidbackground = BossFrame:CreateTexture(nil, "BORDER")
BossFrame.raidbackground:SetPoint("TOPLEFT", BossFrame, "TOPLEFT", 0, -74)
BossFrame.raidbackground:SetPoint("bottomright", BossFrame, "bottomright", 0, 0)
BossFrame.raidbackground:SetDrawLayer ("BORDER", 2)
BossFrame.raidbackground:SetDrawLayer("BORDER", 2)
BossFrame.raidbackground:SetAlpha(0.1)
--boto fechar
@@ -1445,7 +1445,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
local i = 0
local lower = string.lower
for index, data in ipairs(emote_pool) do
if (lower (data [2]):find (lower(searching))) then
if (lower (data [2]):find(lower(searching))) then
i = i + 1
emote_search_table [i] = data
end
@@ -1485,9 +1485,9 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
local color_string = EncounterDetails.BossWhispColors [data [4]]
local color_table = ChatTypeInfo [color_string]
bar.righttext:SetTextColor (color_table.r, color_table.g, color_table.b)
bar.righttext:SetTextColor(color_table.r, color_table.g, color_table.b)
bar.icon:SetTexture([[Interface\CHARACTERFRAME\UI-StateIcon]])
bar.icon:SetTexCoord (0, 0.5, 0.5, 1)
bar.icon:SetTexCoord(0, 0.5, 0.5, 1)
bar.icon:SetBlendMode("ADD")
else
bar:Hide()
@@ -1545,20 +1545,20 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
local reportFunc = function()
-- remove textures
text = text:gsub ("(|T).*(|t)", "")
text = text:gsub("(|T).*(|t)", "")
-- remove colors
text = text:gsub ("|c%x?%x?%x?%x?%x?%x?%x?%x?", "")
text = text:gsub ("|r", "")
text = text:gsub("|c%x?%x?%x?%x?%x?%x?%x?%x?", "")
text = text:gsub("|r", "")
-- replace links
for _, spellid in text:gmatch ("(|Hspell:)(.-)(|h)") do
local spell = tonumber (spellid)
local spell = tonumber(spellid)
local link = GetSpellLink(spell)
text = text:gsub ("(|Hspell).*(|h)", link)
text = text:gsub("(|Hspell).*(|h)", link)
end
-- remove unit links
text = text:gsub ("(|Hunit).-(|h)", "")
text = text:gsub("(|Hunit).-(|h)", "")
-- remove the left space
text = text:gsub ("^%s$", "")
text = text:gsub("^%s$", "")
EncounterDetails:SendReportLines ({"Details! Encounter Emote at " .. timeString, "\"" .. text .. "\""})
end
@@ -1695,20 +1695,20 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
--"|Hunit:77182:Oregorger|hOregorger prepares to cast |cFFFF0000|Hspell:156879|h[Blackrock Barrage]|h|r."
-- remove textures
text = text:gsub ("(|T).*(|t)", "")
text = text:gsub("(|T).*(|t)", "")
-- remove colors
text = text:gsub ("|c%x?%x?%x?%x?%x?%x?%x?%x?", "")
text = text:gsub ("|r", "")
text = text:gsub("|c%x?%x?%x?%x?%x?%x?%x?%x?", "")
text = text:gsub("|r", "")
-- replace links
for _, spellid in text:gmatch ("(|Hspell:)(.-)(|h)") do
local spell = tonumber (spellid)
local spell = tonumber(spellid)
local link = GetSpellLink(spell)
text = text:gsub ("(|Hspell).*(|h)", link)
text = text:gsub("(|Hspell).*(|h)", link)
end
-- remove unit links
text = text:gsub ("(|Hunit).-(|h)", "")
text = text:gsub("(|Hunit).-(|h)", "")
-- remove the left space
text = text:gsub ("^%s$", "")
text = text:gsub("^%s$", "")
tinsert(EncounterDetails.report_lines, timeString .. " " .. text)
added = added + 1
@@ -1842,10 +1842,10 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
for i = 1, CONST_MAX_AURA_LINES do
local anchor_frame = CreateFrame("frame", "BossFrameBossModsAnchor" .. i, BossFrame, "BackdropTemplate")
local spellicon = DetailsFrameWork:NewImage (anchor_frame, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon")
local spellicon = DetailsFrameWork:NewImage(anchor_frame, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon")
--timerId
local spellid = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 80, 20, nil, "$parentSpellId")
local spellid = DetailsFrameWork:CreateTextEntry(anchor_frame, EncounterDetails.empty_function, 80, 20, nil, "$parentSpellId")
spellid:SetTemplate(AurasButtonTemplate)
spellid:SetHook("OnEditFocusGained", on_focus_gain)
spellid:SetHook("OnEditFocusLost", on_focus_lost)
@@ -1853,7 +1853,7 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
spellid:SetHook("OnLeave", on_leave_spell)
--ability name
local spellname = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 180, 20, nil, "$parentSpellName")
local spellname = DetailsFrameWork:CreateTextEntry(anchor_frame, EncounterDetails.empty_function, 180, 20, nil, "$parentSpellName")
spellname:SetTemplate(AurasButtonTemplate)
spellname:SetHook("OnEditFocusGained", on_focus_gain)
spellname:SetHook("OnEditFocusLost", on_focus_lost)
@@ -1887,16 +1887,16 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
for i = 1, CONST_MAX_AURA_LINES do
local anchor_frame = CreateFrame("frame", "BossFrameSpellAnchor" .. i, BossFrame, "BackdropTemplate")
local spellicon = DetailsFrameWork:NewImage (anchor_frame, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon")
local spellicon = DetailsFrameWork:NewImage(anchor_frame, [[Interface\ICONS\TEMP]], 19, 19, "background", nil, "icon", "$parentIcon")
local spellid = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 80, 20)
local spellid = DetailsFrameWork:CreateTextEntry(anchor_frame, EncounterDetails.empty_function, 80, 20)
spellid:SetTemplate(AurasButtonTemplate)
spellid:SetHook("OnEditFocusGained", on_focus_gain)
spellid:SetHook("OnEditFocusLost", on_focus_lost)
spellid:SetHook("OnEnter", on_enter_spell)
spellid:SetHook("OnLeave", on_leave_spell)
local spellname = DetailsFrameWork:CreateTextEntry (anchor_frame, EncounterDetails.empty_function, 160, 20)
local spellname = DetailsFrameWork:CreateTextEntry(anchor_frame, EncounterDetails.empty_function, 160, 20)
spellname:SetTemplate(AurasButtonTemplate)
spellname:SetHook("OnEditFocusGained", on_focus_gain)
spellname:SetHook("OnEditFocusLost", on_focus_lost)
@@ -2133,9 +2133,9 @@ _detalhes.EncounterDetailsTempWindow = function(EncounterDetails)
if (timer_table.id == encounter_id) then
local spell = timer_id
if (spell and not already_added [spell]) then
local int_spell = tonumber (spell)
local int_spell = tonumber(spell)
if (not int_spell) then
local spellname = timer_table [2]:gsub (" %(.%)", "")
local spellname = timer_table [2]:gsub(" %(.%)", "")
tinsert(t, {label = spellname, value = {timer_table [2], spellname, timer_table [5], timer_table.id}, icon = timer_table [5], onclick = on_select_bw_bar})
elseif (int_spell < 0) then
local title, description, depth, abilityIcon, displayInfo, siblingID, nextSectionID, filteredByDifficulty, link, startsOpen, flag1, flag2, flag3, flag4 = C_EncounterJournal.GetSectionInfo (abs(int_spell))
@@ -2182,8 +2182,8 @@ function PhaseFrame:ClearAll()
end
--update damage and healing scrolls
table.wipe (PhaseFrame.DamageTable)
table.wipe (PhaseFrame.HealingTable)
table.wipe(PhaseFrame.DamageTable)
table.wipe(PhaseFrame.HealingTable)
--refresh the scroll
PhaseFrame.Damage_Scroll:Refresh()
@@ -2239,13 +2239,13 @@ function PhaseFrame.OnSelectPhase (phaseSelected)
end
--update damage and healing scrolls
table.wipe (PhaseFrame.DamageTable)
table.wipe(PhaseFrame.DamageTable)
for charName, amount in pairs(phaseData.damage [phaseSelected]) do
tinsert(PhaseFrame.DamageTable, {charName, amount})
end
table.sort (PhaseFrame.DamageTable, function(a, b) return a[2] > b[2] end)
table.wipe (PhaseFrame.HealingTable)
table.wipe(PhaseFrame.HealingTable)
for charName, amount in pairs(phaseData.heal [phaseSelected]) do
tinsert(PhaseFrame.HealingTable, {charName, amount})
end
@@ -2339,11 +2339,11 @@ local ScrollRefresh = function(self, data, offset, total_lines)
local texture, L, R, T, B = _detalhes:GetPlayerIcon (player[1], PhaseFrame.CurrentSegment)
line.icon:SetTexture(texture)
line.icon:SetTexCoord (L, R, T, B)
line.icon:SetTexCoord(L, R, T, B)
line.name:SetText(index .. ". " .. removeRealm (_, player[1]))
line.done:SetText(formatToK (_, player[2]) .. " (" .. format ("%.1f", player[2] / topValue * 100) .. "%)")
line.done:SetText(formatToK (_, player[2]) .. " (" .. format("%.1f", player[2] / topValue * 100) .. "%)")
line.statusbar:SetValue(player[2] / topValue * 100)
local actorClass = Details:GetClass (player[1])
local actorClass = Details:GetClass(player[1])
if (actorClass) then
line.statusbar:SetColor (actorClass)
else
@@ -2642,7 +2642,7 @@ end
options:SetIcon ([[Interface\Buttons\UI-OptionsButton]], 14, 14, nil, {0, 1, 0, 1}, nil, 3)
--macro box
BossFrame.MacroEditBox = DetailsFrameWork:CreateTextEntry (frame, function()end, 300, 20)
BossFrame.MacroEditBox = DetailsFrameWork:CreateTextEntry(frame, function()end, 300, 20)
BossFrame.MacroEditBox:SetPoint("left", options, "right", 10, 0)
BossFrame.MacroEditBox:SetAlpha(0.5)
BossFrame.MacroEditBox:SetText("/run Details:OpenPlugin ('Encounter Breakdown')")
@@ -2655,7 +2655,7 @@ end
BossFrame.MacroEditBox.BackgroundLabel = DetailsFrameWork:CreateLabel(BossFrame.MacroEditBox, "macro")
BossFrame.MacroEditBox.BackgroundLabel:SetPoint("left", BossFrame.MacroEditBox, "left", 6, 0)
BossFrame.MacroEditBox.BackgroundLabel:SetTextColor (.3, .3, .3, .98)
BossFrame.MacroEditBox.BackgroundLabel:SetTextColor(.3, .3, .3, .98)
--Caixa do Dano total tomado pela Raid
+16 -16
View File
@@ -258,9 +258,9 @@ local function CreatePluginFrames()
left_resize:SetNormalTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Up]])
left_resize:SetHighlightTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Highlight]])
left_resize:SetPushedTexture([[Interface\CHATFRAME\UI-ChatIM-SizeGrabber-Down]])
left_resize:GetNormalTexture():SetTexCoord (1, 0, 0, 1)
left_resize:GetHighlightTexture():SetTexCoord (1, 0, 0, 1)
left_resize:GetPushedTexture():SetTexCoord (1, 0, 0, 1)
left_resize:GetNormalTexture():SetTexCoord(1, 0, 0, 1)
left_resize:GetHighlightTexture():SetTexCoord(1, 0, 0, 1)
left_resize:GetPushedTexture():SetTexCoord(1, 0, 0, 1)
left_resize:SetScript("OnMouseDown", function(self)
if (not SOF.resizing and not StreamOverlay.db.main_frame_locked) then
@@ -470,7 +470,7 @@ local function CreatePluginFrames()
--left
line.icon1:SetTexture(data [1])
line.icon1:SetTexCoord (5/64, 59/64, 5/64, 59/64)
line.icon1:SetTexCoord(5/64, 59/64, 5/64, 59/64)
local text = data [2]
line.text1:SetText(text)
@@ -500,13 +500,13 @@ local function CreatePluginFrames()
end
if (data[7]) then
line.text2:SetTextColor (data[7].r, data[7].g, data[7].b)
line.text2:SetTextColor(data[7].r, data[7].g, data[7].b)
else
line.text2:SetTextColor (1, 1, 1)
line.text2:SetTextColor(1, 1, 1)
end
line.icon2:SetTexture(data [4])
line.icon2:SetTexCoord (unpack(data [5]))
line.icon2:SetTexCoord(unpack(data [5]))
if (data [4] == defaultAttackIcon) then
line.icon2:SetSize(iconSize*0.8, iconSize*0.8)
line.icon2:SetPoint("left", line, "center", 8, 0)
@@ -584,7 +584,7 @@ local function CreatePluginFrames()
local statusbar = CreateFrame("StatusBar", "StreamOverlayBar" .. index .. "StatusBar", f, "BackdropTemplate")
local statusbar_texture = statusbar:CreateTexture(nil, "border")
statusbar_texture:SetTexture(1, 1, 1, 0.15)
statusbar:SetStatusBarColor (0, 0, 0, 0)
statusbar:SetStatusBarColor(0, 0, 0, 0)
statusbar:SetStatusBarTexture (statusbar_texture)
statusbar:SetMinMaxValues(0, 100)
statusbar:SetValue(0)
@@ -992,7 +992,7 @@ local parse_target_icon = function(targetObject, target)
end
end
else
local _, class = UnitClass (targetObject.nome)
local _, class = UnitClass(targetObject.nome)
if (class) then
icon2 = [[Interface\AddOns\Details\images\classes_small_alpha]]
icon2coords = Details.class_coords [class]
@@ -1003,7 +1003,7 @@ local parse_target_icon = function(targetObject, target)
end
end
else
local _, class = UnitClass (target)
local _, class = UnitClass(target)
if (class) then
icon2 = [[Interface\AddOns\Details\images\classes_small_alpha]]
icon2coords = Details.class_coords [class]
@@ -1466,7 +1466,7 @@ eventFrame:SetScript("OnEvent", function(self, event, ...)
end)
local format_time = function(v) return "-" .. format ("%.2f", v) end
local format_time = function(v) return "-" .. format("%.2f", v) end
--when the player die, show the events before the death
function StreamOverlay.OnDeath (_, token, time, who_serial, who_name, who_flags, alvo_serial, alvo_name, alvo_flags, death_table, last_cooldown, death_at_combattime, max_health)
@@ -1826,7 +1826,7 @@ function StreamOverlay.OpenOptionsPanel (fromOptionsPanel)
local arrowIconTable = {}
for _, arrow in ipairs(arrows) do
arrowIconTable[#arrowIconTable+1] = {value = arrow, label = arrow:gsub ("Interface(.*)\\", ""), onclick = setArrowTextureCallback, icon = arrow}
arrowIconTable[#arrowIconTable+1] = {value = arrow, label = arrow:gsub("Interface(.*)\\", ""), onclick = setArrowTextureCallback, icon = arrow}
end
--
@@ -2581,10 +2581,10 @@ editbox:SetSize(300, 700)
editbox:SetPoint("topleft", UIParent, "topleft")
editbox:SetBackdrop({bgFile = "Interface\\AddOns\\Details\\images\\background", tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}})
editbox:SetBackdropColor(0, 0, 0, .2)
editbox:SetAutoFocus (false)
editbox:SetAutoFocus(false)
editbox:ClearFocus()
editbox:SetMultiLine (true)
editbox:SetFontObject (GameFontHighlightSmall)
editbox:SetFontObject(GameFontHighlightSmall)
editbox:SetJustifyH("CENTER")
editbox:EnableMouse(true)
editbox:SetText("")
@@ -2599,9 +2599,9 @@ local helpful_spells = StreamOverlay.HelpfulSpells
if (not harmful_spells [spellid] and not helpful_spells [spellid]) then
if (bit.band(who_flags, 0x00000400) ~= 0 and who_name) then
local text = editbox:GetText()
if (not list:find (spellid) and not text:find (spellid)) then
if (not list:find(spellid) and not text:find(spellid)) then
local class = _detalhes:GetClass (who_name) or "unknow"
local class = _detalhes:GetClass(who_name) or "unknow"
if (class ~= "unknow") then
text = text .. "\n"..spellid .. " " .. spellname .. " " .. class
@@ -372,7 +372,7 @@ local function CreatePluginFrames (data)
UpdateTableFromThreatSituation(threat_table, "player", unitId)
--pet
if (UnitExists ("pet")) then
if (UnitExists("pet")) then
local thisplayer_name = GetUnitName("pet", true) .. " *PET*"
local threat_table_index = ThreatMeter.player_list_hash [thisplayer_name]
local threat_table = ThreatMeter.player_list_indexes [threat_table_index]
@@ -443,7 +443,7 @@ local function CreatePluginFrames (data)
if needRelativePullBar then
thisRow._icon:SetTexture([[Interface\PVPFrame\Icon-Combat]])
thisRow._icon:SetTexCoord (0, 1, 0, 1)
thisRow._icon:SetTexCoord(0, 1, 0, 1)
local myPullThreat = me[6]*(100/me[2])
local r,g = ThreatMeter:percent_color(me[2], true)
@@ -465,7 +465,7 @@ local function CreatePluginFrames (data)
if needRangedPullBar and ((not threatActor) or (threatActor[7] < 130)) then
thisRow._icon:SetTexture([[Interface\PaperDoll\UI-PaperDoll-Slot-Ranged]])
thisRow._icon:SetTexCoord (0, 1, 0, 1)
thisRow._icon:SetTexCoord(0, 1, 0, 1)
thisRow:SetLeftText ("Ranged pull at")
thisRow:SetRightText(ThreatMeter:ToK2 (mainTankAbsoluteThreat*1.3) .. " (130.0%)")
@@ -483,7 +483,7 @@ local function CreatePluginFrames (data)
if needMeleePullBar and ((not threatActor) or (threatActor[7] < 110)) then
thisRow._icon:SetTexture([[Interface\PaperDoll\UI-PaperDoll-Slot-MainHand]])
thisRow._icon:SetTexCoord (0, 1, 0, 1)
thisRow._icon:SetTexCoord(0, 1, 0, 1)
thisRow:SetLeftText ("Melee pull at")
thisRow:SetRightText(ThreatMeter:ToK2 (mainTankAbsoluteThreat*1.1) .. " (110.0%)")
@@ -501,7 +501,7 @@ local function CreatePluginFrames (data)
if needMainTankDummyBar and ((not threatActor) or (not useAbsoluteMode) or (threatActor[6] < mainTankAbsoluteThreat)) then
thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
thisRow._icon:SetTexCoord (_unpack(RoleIconCoord ["TANK"]))
thisRow._icon:SetTexCoord(_unpack(RoleIconCoord ["TANK"]))
thisRow:SetLeftText ("Current Tank")
thisRow:SetRightText(ThreatMeter:ToK2 (mainTankAbsoluteThreat) .. " (100.0%)")
@@ -530,7 +530,7 @@ local function CreatePluginFrames (data)
if gougeThreshold and ((not threatActor) or (threatActor[6] < gougeThreshold)) then
local spellName, _, spellTexture = GetSpellInfo(gougeSpellId)
thisRow._icon:SetTexture(spellTexture)
thisRow._icon:SetTexCoord (0, 1, 0, 1)
thisRow._icon:SetTexCoord(0, 1, 0, 1)
local pct = gougeThreshold * 100 / mainTankAbsoluteThreat
@@ -551,7 +551,7 @@ local function CreatePluginFrames (data)
if (threatActor) then
local role = threatActor[4]
thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
thisRow._icon:SetTexCoord (_unpack(RoleIconCoord [role]))
thisRow._icon:SetTexCoord(_unpack(RoleIconCoord [role]))
thisRow:SetLeftText (ThreatMeter:GetOnlyName(threatActor [1]))
@@ -608,10 +608,10 @@ local function CreatePluginFrames (data)
if (threat_actor [2] and threat_actor [2] > 0.1) then
local thisRow = ThreatMeter.ShownRows [#ThreatMeter.ShownRows]
thisRow:SetLeftText (player)
--thisRow.textleft:SetTextColor (unpack(RAID_CLASS_COLORS [threat_actor [5]]))
--thisRow.textleft:SetTextColor(unpack(RAID_CLASS_COLORS [threat_actor [5]]))
local role = threat_actor [4]
thisRow._icon:SetTexture([[Interface\LFGFrame\UI-LFG-Icon-PortraitRoles]])
thisRow._icon:SetTexCoord (_unpack(RoleIconCoord [role]))
thisRow._icon:SetTexCoord(_unpack(RoleIconCoord [role]))
thisRow:SetRightText (ThreatMeter:ToK2 (threat_actor [6]) .. " (" .. _cstr ("%.1f", threat_actor [2]) .. "%)")
thisRow:SetValue(threat_actor [2])
@@ -665,7 +665,7 @@ local function CreatePluginFrames (data)
for i = 1, GetNumGroupMembers(), 1 do
local thisplayer_name = GetUnitName("raid"..i, true)
local role = _UnitGroupRolesAssigned(thisplayer_name)
local _, class = UnitClass (thisplayer_name)
local _, class = UnitClass(thisplayer_name)
local t = {thisplayer_name, 0, false, role, class, 0, 0}
ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t
ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes
@@ -675,14 +675,14 @@ local function CreatePluginFrames (data)
for i = 1, GetNumGroupMembers()-1, 1 do
local thisplayer_name = GetUnitName("party"..i, true)
local role = _UnitGroupRolesAssigned(thisplayer_name)
local _, class = UnitClass (thisplayer_name)
local _, class = UnitClass(thisplayer_name)
local t = {thisplayer_name, 0, false, role, class, 0, 0}
ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t
ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes
end
local thisplayer_name = GetUnitName("player", true)
local role = _UnitGroupRolesAssigned(thisplayer_name)
local _, class = UnitClass (thisplayer_name)
local _, class = UnitClass(thisplayer_name)
local t = {thisplayer_name, 0, false, role, class, 0, 0}
ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t
ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes
@@ -690,12 +690,12 @@ local function CreatePluginFrames (data)
else
local thisplayer_name = GetUnitName("player", true)
local role = _UnitGroupRolesAssigned(thisplayer_name)
local _, class = UnitClass (thisplayer_name)
local _, class = UnitClass(thisplayer_name)
local t = {thisplayer_name, 0, false, role, class, 0, 0}
ThreatMeter.player_list_indexes [#ThreatMeter.player_list_indexes+1] = t
ThreatMeter.player_list_hash [thisplayer_name] = #ThreatMeter.player_list_indexes
if (UnitExists ("pet")) then
if (UnitExists("pet")) then
local thispet_name = GetUnitName("pet", true) .. " *PET*"
local role = "DAMAGER"
local t = {thispet_name, 0, false, role, class, 0, 0}
@@ -906,7 +906,7 @@ function ThreatMeter:OnEvent (_, event, ...)
elseif (command == Loc ["STRING_SLASH_SPEED"]) then
if (rest) then
local speed = tonumber (rest)
local speed = tonumber(rest)
if (speed) then
if (speed > 3) then
speed = 3
@@ -183,10 +183,10 @@ local function CreatePluginFrames (data)
--search for tanks in the raid or party group
function Vanguard:IdentifyTanks()
table.wipe (Vanguard.TankList)
table.wipe (Vanguard.TankHashNames)
table.wipe (Vanguard.TankIncDamage)
table.wipe (Vanguard.UnitIdCache)
table.wipe(Vanguard.TankList)
table.wipe(Vanguard.TankHashNames)
table.wipe(Vanguard.TankIncDamage)
table.wipe(Vanguard.UnitIdCache)
for i = 1, CONST_MAX_TANKS do
Vanguard.auraUpdateFrames[i]:UnregisterEvent("UNIT_AURA")
@@ -319,16 +319,16 @@ local function CreatePluginFrames (data)
local bar = self.heal_inc
bar.tankname = name
local class, left, right, top, bottom, r, g, b = Vanguard:GetClass (name)
local class, left, right, top, bottom, r, g, b = Vanguard:GetClass(name)
local spec = Vanguard:GetSpec (name)
if (spec) then
self.specicon:SetTexture(Vanguard.CurrentInstance.row_info.spec_file)
self.specicon:SetTexCoord (_unpack(Vanguard.class_specs_coords [spec]))
self.specicon:SetTexCoord(_unpack(Vanguard.class_specs_coords [spec]))
else
self.specicon:SetTexture(Vanguard.CurrentInstance.row_info.icon_file)
self.specicon:SetTexCoord (left, right, top, bottom)
self.specicon:SetTexCoord(left, right, top, bottom)
end
self.unitFrame:SetUnit(Vanguard.UnitIdCache[name])
@@ -338,7 +338,7 @@ local function CreatePluginFrames (data)
self.unitFrame.healthBar:SetColor(r, g, b)
bar.lefticon = Vanguard.CurrentInstance.row_info.icon_file
bar.iconleft:SetTexCoord (left, right, top, bottom)
bar.iconleft:SetTexCoord(left, right, top, bottom)
bar:SetLeftText (Vanguard:GetOnlyName(name))
bar:SetLeftText (name)
+110 -109
View File
@@ -107,113 +107,114 @@ function Details:StartMeUp() --I'll never stop!
self.atributo_custom:UpdateSelectedToKFunction()
--start instances updater
self:CheckSwitchOnLogon()
self:CheckSwitchOnLogon()
function Details:ScheduledWindowUpdate(forced)
if (not forced and Details.in_combat) then
return
end
function Details:ScheduledWindowUpdate(forced)
if (not forced and Details.in_combat) then
return
end
Details.scheduled_window_update = nil
Details:RefreshMainWindow(-1, true)
end
function Details:ScheduleWindowUpdate(time, forced)
if (Details.scheduled_window_update) then
Details.Schedules.Cancel(Details.scheduled_window_update)
Details.scheduled_window_update = nil
Details:RefreshMainWindow(-1, true)
end
function Details:ScheduleWindowUpdate(time, forced)
if (Details.scheduled_window_update) then
Details.Schedules.Cancel(Details.scheduled_window_update)
Details.scheduled_window_update = nil
Details.scheduled_window_update = Details.Schedules.NewTimer(time or 1, Details.ScheduledWindowUpdate, Details, forced)
end
self:RefreshMainWindow(-1, true)
Details:RefreshUpdater()
for id = 1, Details:GetNumInstances() do
local instance = Details:GetInstance(id)
if (instance:IsEnabled()) then
Details.Schedules.NewTimer(1, Details.RefreshBars, Details, instance)
Details.Schedules.NewTimer(1, Details.InstanceReset, Details, instance)
Details.Schedules.NewTimer(1, Details.InstanceRefreshRows, Details, instance)
end
end
function self:RefreshAfterStartup()
--repair nicknames as nicknames aren't saved within the actor when leaving the game
if (not Details.ignore_nicktag) then
local currentCombat = Details:GetCurrentCombat()
local containerDamage = currentCombat:GetContainer(DETAILS_ATTRIBUTE_DAMAGE)
for _, actorObject in containerDamage:ListActors() do
--get the actor nickname
local nickname = Details:GetNickname(actorObject:Name(), false, true)
if (nickname and type(nickname) == "string" and nickname:len() >= 2) then
actorObject:SetDisplayName(nickname)
end
end
Details.scheduled_window_update = Details.Schedules.NewTimer(time or 1, Details.ScheduledWindowUpdate, Details, forced)
end
self:RefreshMainWindow(-1, true)
Details:RefreshUpdater()
local refreshAllInstances = -1
local forceRefresh = true
self:RefreshMainWindow(refreshAllInstances, forceRefresh)
local lowerInstance = Details:GetLowerInstanceNumber()
for id = 1, Details:GetNumInstances() do
local instance = Details:GetInstance(id)
if (instance:IsEnabled()) then
Details.Schedules.NewTimer(1, Details.RefreshBars, Details, instance)
Details.Schedules.NewTimer(1, Details.InstanceReset, Details, instance)
Details.Schedules.NewTimer(1, Details.InstanceRefreshRows, Details, instance)
--refresh wallpaper
if (instance.wallpaper.enabled) then
instance:InstanceWallpaper(true)
else
instance:InstanceWallpaper(false)
end
--refresh desaturated icons if is lower instance because plugins shall have installed their icons at this point
if (id == lowerInstance) then
instance:DesaturateMenu()
instance:SetAutoHideMenu(nil, nil, true)
end
end
end
function self:RefreshAfterStartup()
--repair nicknames as nicknames aren't saved within the actor when leaving the game
if (not Details.ignore_nicktag) then
local currentCombat = Details:GetCurrentCombat()
local containerDamage = currentCombat:GetContainer(DETAILS_ATTRIBUTE_DAMAGE)
for _, actorObject in containerDamage:ListActors() do
--get the actor nickname
local nickname = Details:GetNickname(actorObject:Name(), false, true)
if (nickname and type(nickname) == "string" and nickname:len() >= 2) then
actorObject:SetDisplayName(nickname)
end
--refresh lower instance plugin icons and skin
Details.ToolBar:ReorganizeIcons()
--refresh skin for other windows
if (lowerInstance) then
for id = lowerInstance+1, Details:GetNumInstances() do
local instance = Details:GetInstance(id)
if (instance and instance.baseframe and instance.ativa) then
instance:ChangeSkin()
end
end
end
local refreshAllInstances = -1
local forceRefresh = true
self:RefreshMainWindow(refreshAllInstances, forceRefresh)
local lowerInstance = Details:GetLowerInstanceNumber()
self.RefreshAfterStartup = nil
for id = 1, Details:GetNumInstances() do
local instance = Details:GetInstance(id)
if (instance:IsEnabled()) then
--refresh wallpaper
if (instance.wallpaper.enabled) then
instance:InstanceWallpaper(true)
else
function Details:CheckWallpaperAfterStartup()
if (not Details.profile_loaded) then
Details.Schedules.NewTimer(5, Details.CheckWallpaperAfterStartup, Details)
end
for id = 1, self.instances_amount do
local instance = self:GetInstance(id)
if (instance and instance:IsEnabled()) then
if (not instance.wallpaper.enabled) then
instance:InstanceWallpaper(false)
end
--refresh desaturated icons if is lower instance because plugins shall have installed their icons at this point
if (id == lowerInstance) then
instance:DesaturateMenu()
instance:SetAutoHideMenu(nil, nil, true)
end
instance.do_not_snap = true
self.move_janela_func(instance.baseframe, true, instance, true)
self.move_janela_func(instance.baseframe, false, instance, true)
instance.do_not_snap = false
end
end
--refresh lower instance plugin icons and skin
Details.ToolBar:ReorganizeIcons()
--refresh skin for other windows
if (lowerInstance) then
for id = lowerInstance+1, Details:GetNumInstances() do
local instance = Details:GetInstance(id)
if (instance and instance.baseframe and instance.ativa) then
instance:ChangeSkin()
end
end
end
self.RefreshAfterStartup = nil
function Details:CheckWallpaperAfterStartup()
if (not Details.profile_loaded) then
Details.Schedules.NewTimer(5, Details.CheckWallpaperAfterStartup, Details)
end
for id = 1, self.instances_amount do
local instance = self:GetInstance(id)
if (instance and instance:IsEnabled()) then
if (not instance.wallpaper.enabled) then
instance:InstanceWallpaper(false)
end
instance.do_not_snap = true
self.move_janela_func(instance.baseframe, true, instance, true)
self.move_janela_func(instance.baseframe, false, instance, true)
instance.do_not_snap = false
end
end
self.CheckWallpaperAfterStartup = nil
Details.profile_loaded = nil
end
Details.Schedules.NewTimer(5, Details.CheckWallpaperAfterStartup, Details)
self.CheckWallpaperAfterStartup = nil
Details.profile_loaded = nil
end
Details.Schedules.NewTimer(5, Details.CheckWallpaperAfterStartup, Details)
end
Details.Schedules.NewTimer(5, Details.RefreshAfterStartup, Details)
Details.Schedules.NewTimer(5, Details.RefreshAfterStartup, Details)
--start garbage collector
self.ultima_coleta = 0
@@ -225,42 +226,41 @@ function Details:StartMeUp() --I'll never stop!
--player role
self.last_assigned_role = UnitGroupRolesAssigned and UnitGroupRolesAssigned("player")
--start parser
--load parser capture options
self:CaptureRefresh()
--load parser capture options
self:CaptureRefresh()
--register parser events
self.listener:RegisterEvent("PLAYER_REGEN_DISABLED")
self.listener:RegisterEvent("PLAYER_REGEN_ENABLED")
self.listener:RegisterEvent("UNIT_PET")
--register parser events
self.listener:RegisterEvent("PLAYER_REGEN_DISABLED")
self.listener:RegisterEvent("PLAYER_REGEN_ENABLED")
self.listener:RegisterEvent("UNIT_PET")
self.listener:RegisterEvent("GROUP_ROSTER_UPDATE")
self.listener:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT")
self.listener:RegisterEvent("GROUP_ROSTER_UPDATE")
self.listener:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT")
self.listener:RegisterEvent("ZONE_CHANGED_NEW_AREA")
self.listener:RegisterEvent("PLAYER_ENTERING_WORLD")
self.listener:RegisterEvent("ZONE_CHANGED_NEW_AREA")
self.listener:RegisterEvent("PLAYER_ENTERING_WORLD")
self.listener:RegisterEvent("ENCOUNTER_START")
self.listener:RegisterEvent("ENCOUNTER_END")
self.listener:RegisterEvent("ENCOUNTER_START")
self.listener:RegisterEvent("ENCOUNTER_END")
self.listener:RegisterEvent("START_TIMER")
self.listener:RegisterEvent("UNIT_NAME_UPDATE")
self.listener:RegisterEvent("START_TIMER")
self.listener:RegisterEvent("UNIT_NAME_UPDATE")
self.listener:RegisterEvent("PLAYER_ROLES_ASSIGNED")
self.listener:RegisterEvent("ROLE_CHANGED_INFORM")
self.listener:RegisterEvent("PLAYER_ROLES_ASSIGNED")
self.listener:RegisterEvent("ROLE_CHANGED_INFORM")
self.listener:RegisterEvent("UNIT_FACTION")
self.listener:RegisterEvent("UNIT_FACTION")
if (not DetailsFramework.IsTimewalkWoW()) then
self.listener:RegisterEvent("PET_BATTLE_OPENING_START")
self.listener:RegisterEvent("PET_BATTLE_CLOSE")
self.listener:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
self.listener:RegisterEvent("PLAYER_TALENT_UPDATE")
self.listener:RegisterEvent("CHALLENGE_MODE_START")
self.listener:RegisterEvent("CHALLENGE_MODE_COMPLETED")
end
if (not DetailsFramework.IsTimewalkWoW()) then
self.listener:RegisterEvent("PET_BATTLE_OPENING_START")
self.listener:RegisterEvent("PET_BATTLE_CLOSE")
self.listener:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED")
self.listener:RegisterEvent("PLAYER_TALENT_UPDATE")
self.listener:RegisterEvent("CHALLENGE_MODE_START")
self.listener:RegisterEvent("CHALLENGE_MODE_COMPLETED")
end
self.parser_frame:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
self.parser_frame:RegisterEvent ("COMBAT_LOG_EVENT_UNFILTERED")
--update is in group
self.details_users = {}
@@ -402,6 +402,7 @@ function Details:StartMeUp() --I'll never stop!
--Details:OpenCustomDisplayWindow()
--Details:OpenWelcomeWindow()
end
Details.Schedules.NewTimer(2, Details.OpenOptionsWindowAtStart, Details)
--Details:OpenCustomDisplayWindow()