Verified Commit e5ff0180 authored by Luckyone's avatar Luckyone
Browse files

Merge branch 'beta' into ptr

parents fd55c54b f448866c
### Version 11.52 [ ETA: 🍨 ]
### Version 11.53 [ ETA: 🍨 ]
**Shiny:**
Objective Tracker option to hide while in Mythic Keystone runs.
Config button border color wasn't updating when changing border color.
___
### Version 11.52 [ September 4th 2020 ]
**Shiny:**
Config button borders werent updating when changing border color.
Objective Tracker optional setting to hide while in Mythic Keystone runs.
New option to Allow Profile Sharing (off by default) in profile section.
Updated Font Outline options and fixed it not working when adjusting.
A wild error appeared with [name:health] tag which is resolved now.
Friends Datatext will show characters on connected realms too.
Player Nameplate should behave more often now.. I hope.
SetNamePlateSelfSize error was removed from the code.
Dropdown during Toggle Anchors was busted.
Castbar text was getting cut off.
___
......
......@@ -48,7 +48,7 @@ function E:ClassColor(class, usePriestColor)
color.colorStr = 'ff'..color.colorStr
end
if (usePriestColor and class == 'PRIEST') and tonumber(color.colorStr, 16) > tonumber(E.PriestColors.colorStr, 16) then
if usePriestColor and class == 'PRIEST' and tonumber(color.colorStr, 16) > tonumber(E.PriestColors.colorStr, 16) then
return E.PriestColors
else
return color
......@@ -290,7 +290,7 @@ do
if module == 'all' then
for moduName, modu in pairs(self.modules) do
for funcName, func in pairs(modu) do
if (funcName ~= 'GetModule') and (type(func) == 'function') then
if funcName ~= 'GetModule' and type(func) == 'function' then
CPU_USAGE[moduName..':'..funcName] = GetFunctionCPUUsage(func, true)
end
end
......
......@@ -124,19 +124,19 @@ do
end
local function OnUpdate(self, elapsed)
if(self.elapsed and self.elapsed > 0.1) then
if self.elapsed and self.elapsed > 0.1 then
self.tex:SetTexCoord((self.curFrame - 1) * 0.1, 0, (self.curFrame - 1) * 0.1, 1, self.curFrame * 0.1, 0, self.curFrame * 0.1, 1)
if(self.countUp) then
if self.countUp then
self.curFrame = self.curFrame + 1
else
self.curFrame = self.curFrame - 1
end
if(self.curFrame > 10) then
if self.curFrame > 10 then
self.countUp = false
self.curFrame = 9
elseif(self.curFrame < 1) then
elseif self.curFrame < 1 then
self.countUp = true
self.curFrame = 2
end
......@@ -154,7 +154,7 @@ do
--Store old settings
local t = self.db.tempSettings
local c = self.db.general.backdropcolor
if(self:HelloKittyFixCheck()) then
if self:HelloKittyFixCheck() then
E:HelloKittyFix()
else
self.oldEnableAllSound = GetCVar('Sound_EnableAllSound')
......@@ -216,13 +216,13 @@ do
function E:RestoreHelloKitty()
--Store old settings
self.db.general.kittys = false
if(_G.HelloKittyLeft) then
if _G.HelloKittyLeft then
_G.HelloKittyLeft:Hide()
_G.HelloKittyRight:Hide()
end
if not(self.db.tempSettings) then return end
if(self:HelloKittyFixCheck()) then
if self:HelloKittyFixCheck() then
self:HelloKittyFix()
self.db.tempSettings = nil
return
......@@ -260,7 +260,7 @@ do
end
function E:CreateKittys()
if(_G.HelloKittyLeft) then
if _G.HelloKittyLeft then
_G.HelloKittyLeft:Show()
_G.HelloKittyRight:Show()
return
......@@ -303,8 +303,8 @@ do
--When it bugged out for a user the command '/hellokittyfix' attempted to restore the changed settings to default
function E:HelloKittyFixCheck(secondCheck)
local t = self.db.tempSettings
if(not t and not secondCheck) then t = self.db.general end
if(t and t.backdropcolor)then
if not t and not secondCheck then t = self.db.general end
if t and t.backdropcolor then
return self:Round(t.backdropcolor.r, 2) == 0.87 and self:Round(t.backdropcolor.g, 2) == 0.3 and self:Round(t.backdropcolor.b, 2) == 0.74
end
end
......@@ -336,7 +336,7 @@ do
self.db.unitframe.colors.auraBarBuff = {r = c.r, g = c.g, b = c.b}
self.db.unitframe.colors.transparentAurabars = false
if(_G.HelloKittyLeft) then
if _G.HelloKittyLeft then
_G.HelloKittyLeft:Hide()
_G.HelloKittyRight:Hide()
self.db.general.kittys = nil
......@@ -348,7 +348,7 @@ do
end
function E:HelloKittyToggle()
if(_G.HelloKittyLeft and _G.HelloKittyLeft:IsShown()) then
if _G.HelloKittyLeft and _G.HelloKittyLeft:IsShown() then
self:RestoreHelloKitty()
else
self:StaticPopup_Show('HELLO_KITTY')
......
......@@ -43,7 +43,7 @@ function E:LuaError(msg)
if switch == 'on' or switch == '1' then
for i=1, GetNumAddOns() do
local name = GetAddOnInfo(i)
if (name ~= 'ElvUI' and name ~= 'ElvUI_OptionsUI') and E:IsAddOnEnabled(name) then
if name ~= 'ElvUI' and name ~= 'ElvUI_OptionsUI' and E:IsAddOnEnabled(name) then
DisableAddOn(name, E.myname)
ElvDB.LuaErrorDisabledAddOns[name] = i
end
......@@ -77,7 +77,7 @@ end
function E:DelayScriptCall(msg)
local secs, command = msg:match('^(%S+)%s+(.*)$')
secs = tonumber(secs)
if (not secs) or (#command == 0) then
if not secs or (#command == 0) then
self:Print('usage: /in <seconds> <command>')
self:Print('example: /in 1.5 /say hi')
else
......
......@@ -205,7 +205,7 @@ end
E.RegisteredCooldowns = {}
function E:OnSetCooldown(start, duration)
if (not self.forceDisabled) and (start and duration) and (duration > MIN_DURATION) then
if not self.forceDisabled and (start and duration) and (duration > MIN_DURATION) then
local timer = self.timer or E:CreateCooldownTimer(self)
timer.start = start
timer.duration = duration
......@@ -265,7 +265,7 @@ end
function E:UpdateCooldownOverride(module)
local cooldowns = (module and E.RegisteredCooldowns[module])
if (not cooldowns) or not next(cooldowns) then return end
if not cooldowns or not next(cooldowns) then return end
local blizzText
for _, parent in ipairs(cooldowns) do
......
......@@ -242,9 +242,9 @@ function E:UpdateColorTable(data)
error('UpdateColorTable: Could not unpack color values.')
end
if (data.r > 1 or data.r < 0) then data.r = 1 end
if (data.g > 1 or data.g < 0) then data.g = 1 end
if (data.b > 1 or data.b < 0) then data.b = 1 end
if data.r > 1 or data.r < 0 then data.r = 1 end
if data.g > 1 or data.g < 0 then data.g = 1 end
if data.b > 1 or data.b < 0 then data.b = 1 end
if data.a and (data.a > 1 or data.a < 0) then data.a = 1 end
if data.a then
......@@ -259,9 +259,9 @@ function E:GetColorTable(data)
error('GetColorTable: Could not unpack color values.')
end
if (data.r > 1 or data.r < 0) then data.r = 1 end
if (data.g > 1 or data.g < 0) then data.g = 1 end
if (data.b > 1 or data.b < 0) then data.b = 1 end
if data.r > 1 or data.r < 0 then data.r = 1 end
if data.g > 1 or data.g < 0 then data.g = 1 end
if data.b > 1 or data.b < 0 then data.b = 1 end
if data.a and (data.a > 1 or data.a < 0) then data.a = 1 end
if data.a then
......@@ -449,7 +449,7 @@ function E:UpdateBackdropColors()
if not frame.ignoreUpdates then
if frame.callbackBackdropColor then
frame:callbackBackdropColor()
else
elseif not frame.ignoreBackdropColor then
if frame.template == 'Default' then
frame:SetBackdropColor(r, g, b)
elseif frame.template == 'Transparent' then
......@@ -467,7 +467,7 @@ function E:UpdateBackdropColors()
if not frame.ignoreUpdates then
if frame.callbackBackdropColor then
frame:callbackBackdropColor()
else
elseif not frame.ignoreBackdropColor then
if frame.template == 'Default' then
frame:SetBackdropColor(r, g, b)
elseif frame.template == 'Transparent' then
......@@ -685,7 +685,7 @@ function E:FilterTableFromBlacklist(cleanTable, blacklistTable)
tfbCleaned[option] = E:FilterTableFromBlacklist(value, blacklistTable[option])
else
-- Filter out blacklisted keys
if (blacklistTable[option] ~= true) then
if blacklistTable[option] ~= true then
tfbCleaned[option] = value
end
end
......
......@@ -5,6 +5,7 @@ local _G = _G
local strmatch = strmatch
local function SetFont(obj, font, size, style, sr, sg, sb, sa, sox, soy, r, g, b)
if not obj then return end -- Reports of commenting out the SetFont at the time this was added caused error pls check simpy
obj:SetFont(font, size, style)
if sr and sg and sb then obj:SetShadowColor(sr, sg, sb, sa) end
if sox and soy then obj:SetShadowOffset(sox, soy) end
......@@ -107,7 +108,7 @@ function E:UpdateBlizzardFonts()
SetFont(_G.SystemFont_OutlineThick_WTF, NORMAL, 32, MONOCHROME..'OUTLINE') -- World Map
SetFont(_G.SystemFont_Shadow_Huge1, NORMAL, 20, MONOCHROME..'OUTLINE') -- Raid Warning, Boss emote frame too
SetFont(_G.SystemFont_Shadow_Huge3, NORMAL, 22) -- FlightMap
SetFont(_G.SystemFont_Shadow_Large, NORMAL, 15)
-- SetFont(_G.SystemFont_Shadow_Large, NORMAL, 15) -- Was Erroring out, had to comment out, dbl check simpy
SetFont(_G.SystemFont_Shadow_Large2, NORMAL, 18) -- Auction House ItemDisplay
SetFont(_G.SystemFont_Shadow_Large_Outline, NUMBER, 20, 'OUTLINE')
SetFont(_G.SystemFont_Shadow_Med1, NORMAL, E.db.general.fontSize)
......
......@@ -169,7 +169,7 @@ function E:CalculateAverageItemLevel(iLevelDB, unit)
end
if mainItemLevel and offItemLevel then
if (mainQuality == 6) or (not offEquipLoc and X2_INVTYPES[mainEquipLoc] and X2_EXCEPTIONS[mainItemClass] ~= mainItemSubClass and spec ~= 72) then
if mainQuality == 6 or (not offEquipLoc and X2_INVTYPES[mainEquipLoc] and X2_EXCEPTIONS[mainItemClass] ~= mainItemSubClass and spec ~= 72) then
mainItemLevel = max(mainItemLevel, offItemLevel)
total = total + mainItemLevel * 2
else
......
......@@ -12,13 +12,13 @@ local format, error = format, error
local CreateFrame = CreateFrame
local IsAddOnLoaded = IsAddOnLoaded
local MoneyFrame_Update = MoneyFrame_Update
local UnitIsDeadOrGhost, InCinematic = UnitIsDeadOrGhost, InCinematic
local GetBindingFromClick, RunBinding = GetBindingFromClick, RunBinding
local PurchaseSlot, GetBankSlotCost = PurchaseSlot, GetBankSlotCost
local MoneyFrame_Update = MoneyFrame_Update
local SetCVar, EnableAddOn, DisableAddOn = SetCVar, EnableAddOn, DisableAddOn
local ReloadUI, PlaySound, StopMusic = ReloadUI, PlaySound, StopMusic
local StaticPopup_Resize = StaticPopup_Resize
local GetBindingFromClick = GetBindingFromClick
local AutoCompleteEditBox_OnEnterPressed = AutoCompleteEditBox_OnEnterPressed
local AutoCompleteEditBox_OnTextChanged = AutoCompleteEditBox_OnTextChanged
local ChatEdit_FocusActiveWindow = ChatEdit_FocusActiveWindow
......@@ -121,7 +121,7 @@ E.PopupDialogs.ELVUI_EDITBOX = {
self:GetParent():Hide()
end,
EditBoxOnTextChanged = function(self)
if(self:GetText() ~= self.temptxt) then
if self:GetText() ~= self.temptxt then
self:SetText(self.temptxt)
end
self:HighlightText()
......@@ -502,13 +502,13 @@ function E:StaticPopup_OnShow()
local dialog = E.PopupDialogs[self.which]
local OnShow = dialog.OnShow
if ( OnShow ) then
if OnShow then
OnShow(self, self.data)
end
if ( dialog.hasMoneyInputFrame ) then
if dialog.hasMoneyInputFrame then
_G[self:GetName()..'MoneyInputFrameGold']:SetFocus()
end
if ( dialog.enterClicksFirstButton or dialog.hideOnEscape ) then
if dialog.enterClicksFirstButton or dialog.hideOnEscape then
self:SetScript('OnKeyDown', E.StaticPopup_OnKeyDown)
end
......@@ -530,12 +530,12 @@ end
function E:StaticPopup_EscapePressed()
local closed = nil
for _, frame in pairs(E.StaticPopup_DisplayedFrames) do
if( frame:IsShown() and frame.hideOnEscape ) then
if frame:IsShown() and frame.hideOnEscape then
local standardDialog = E.PopupDialogs[frame.which]
if ( standardDialog ) then
if standardDialog then
local OnCancel = standardDialog.OnCancel
local noCancelOnEscape = standardDialog.noCancelOnEscape
if ( OnCancel and not noCancelOnEscape) then
if OnCancel and not noCancelOnEscape then
OnCancel(frame, frame.data, 'clicked')
end
frame:Hide()
......@@ -578,7 +578,7 @@ function E:StaticPopup_SetUpPosition(dialog)
end
function E:StaticPopupSpecial_Show(frame)
if ( frame.exclusive ) then
if frame.exclusive then
E:StaticPopup_HideExclusive()
end
E:StaticPopup_SetUpPosition(frame)
......@@ -594,7 +594,7 @@ end
function E:StaticPopup_IsLastDisplayedFrame(frame)
for i=#E.StaticPopup_DisplayedFrames, 1, -1 do
local popup = E.StaticPopup_DisplayedFrames[i]
if ( popup:IsShown() ) then
if popup:IsShown() then
return frame == popup
end
end
......@@ -602,30 +602,23 @@ function E:StaticPopup_IsLastDisplayedFrame(frame)
end
function E:StaticPopup_OnKeyDown(key)
if ( GetBindingFromClick(key) == 'TOGGLEGAMEMENU' ) then
if GetBindingFromClick(key) == 'TOGGLEGAMEMENU' then
return E:StaticPopup_EscapePressed()
elseif ( GetBindingFromClick(key) == 'SCREENSHOT' ) then
RunBinding('SCREENSHOT')
return
end
local dialog = E.PopupDialogs[self.which]
if ( dialog ) then
if ( key == 'ENTER' and dialog.enterClicksFirstButton ) then
local frameName = self:GetName()
local button
local i = 1
while ( true ) do
button = _G[frameName..'Button'..i]
if ( button ) then
if ( button:IsShown() ) then
E:StaticPopup_OnClick(self, i)
return
end
i = i + 1
else
break
if dialog then
if key == 'ENTER' and dialog.enterClicksFirstButton then
local i, frameName = 1, self:GetName()
local button = _G[frameName..'Button'..i]
while button do
if button:IsShown() then
E:StaticPopup_OnClick(self, i)
return
end
i = i + 1
button = _G[frameName..'Button'..i]
end
end
end
......@@ -638,11 +631,11 @@ function E:StaticPopup_OnHide()
local dialog = E.PopupDialogs[self.which]
local OnHide = dialog.OnHide
if ( OnHide ) then
if OnHide then
OnHide(self, self.data)
end
self.extraFrame:Hide()
if ( dialog.enterClicksFirstButton ) then
if dialog.enterClicksFirstButton then
self:SetScript('OnKeyDown', nil)
end
......@@ -700,33 +693,33 @@ function E:StaticPopup_OnUpdate(elapsed)
end
function E:StaticPopup_OnClick(index)
if ( not self:IsShown() ) then
if not self:IsShown() then
return
end
local which = self.which
local info = E.PopupDialogs[which]
if ( not info ) then
if not info then
return nil
end
local hide = true
if ( index == 1 ) then
if index == 1 then
local OnAccept = info.OnAccept
if ( OnAccept ) then
if OnAccept then
hide = not OnAccept(self, self.data, self.data2)
end
elseif ( index == 3 ) then
elseif index == 3 then
local OnAlt = info.OnAlt
if ( OnAlt ) then
if OnAlt then
OnAlt(self, self.data, 'clicked')
end
else
local OnCancel = info.OnCancel
if ( OnCancel ) then
if OnCancel then
hide = not OnCancel(self, self.data, 'clicked')
end
end
if ( hide and (which == self.which) ) then
if hide and (which == self.which) then
-- can self.which change inside one of the On* functions???
self:Hide()
end
......@@ -735,17 +728,17 @@ end
function E:StaticPopup_EditBoxOnEnterPressed()
local EditBoxOnEnterPressed, which, dialog
local parent = self:GetParent()
if ( parent.which ) then
if parent.which then
which = parent.which
dialog = parent
elseif ( parent:GetParent().which ) then
elseif parent:GetParent().which then
-- This is needed if this is a money input frame since it's nested deeper than a normal edit box
which = parent:GetParent().which
dialog = parent:GetParent()
end
if ( not self.autoCompleteParams or not AutoCompleteEditBox_OnEnterPressed(self) ) then
if not self.autoCompleteParams or not AutoCompleteEditBox_OnEnterPressed(self) then
EditBoxOnEnterPressed = E.PopupDialogs[which].EditBoxOnEnterPressed
if ( EditBoxOnEnterPressed ) then
if EditBoxOnEnterPressed then
EditBoxOnEnterPressed(self, dialog.data)
end
end
......@@ -753,15 +746,15 @@ end
function E:StaticPopup_EditBoxOnEscapePressed()
local EditBoxOnEscapePressed = E.PopupDialogs[self:GetParent().which].EditBoxOnEscapePressed
if ( EditBoxOnEscapePressed ) then
if EditBoxOnEscapePressed then
EditBoxOnEscapePressed(self, self:GetParent().data)
end
end
function E:StaticPopup_EditBoxOnTextChanged(userInput)
if ( not self.autoCompleteParams or not AutoCompleteEditBox_OnTextChanged(self, userInput) ) then
if not self.autoCompleteParams or not AutoCompleteEditBox_OnTextChanged(self, userInput) then
local EditBoxOnTextChanged = E.PopupDialogs[self:GetParent().which].EditBoxOnTextChanged
if ( EditBoxOnTextChanged ) then
if EditBoxOnTextChanged then
EditBoxOnTextChanged(self, self:GetParent().data)
end
end
......@@ -769,12 +762,12 @@ end
function E:StaticPopup_FindVisible(which, data)
local info = E.PopupDialogs[which]
if ( not info ) then
if not info then
return nil
end
for index = 1, MAX_STATIC_POPUPS, 1 do
local frame = _G['ElvUI_StaticPopup'..index]
if ( frame and frame:IsShown() and (frame.which == which) and (not info.multiple or (frame.data == data)) ) then
if frame and frame:IsShown() and (frame.which == which) and (not info.multiple or (frame.data == data)) then
return frame
end
end
......@@ -783,7 +776,7 @@ end
function E:StaticPopup_Resize(dialog, which)
local info = E.PopupDialogs[which]
if ( not info ) then
if not info then
return nil
end
......@@ -794,36 +787,36 @@ function E:StaticPopup_Resize(dialog, which)
local maxHeightSoFar, maxWidthSoFar = (dialog.maxHeightSoFar or 0), (dialog.maxWidthSoFar or 0)
local width = 320
if ( dialog.numButtons == 3 ) then
if dialog.numButtons == 3 then
width = 440
elseif (info.showAlert or info.showAlertGear or info.closeButton) then
elseif info.showAlert or info.showAlertGear or info.closeButton then
-- Widen
width = 420
elseif ( info.editBoxWidth and info.editBoxWidth > 260 ) then
elseif info.editBoxWidth and info.editBoxWidth > 260 then
width = width + (info.editBoxWidth - 260)
end
if ( width > maxWidthSoFar ) then
if width > maxWidthSoFar then
dialog:Width(width)
dialog.maxWidthSoFar = width
end
local height = 32 + (text and text:GetHeight() or 0) + 8 + button1:GetHeight()
if ( info.hasEditBox ) then
if info.hasEditBox then
height = height + 8 + editBox:GetHeight()
elseif ( info.hasMoneyFrame ) then
elseif info.hasMoneyFrame then
height = height + 16
elseif ( info.hasMoneyInputFrame ) then
elseif info.hasMoneyInputFrame then
height = height + 22
end
if ( info.hasItemFrame ) then
if info.hasItemFrame then
height = height + 64
end
if (info.hasCheckButton ) then
if info.hasCheckButton then
height = height + 32
end
if ( height > maxHeightSoFar ) then
if height > maxHeightSoFar then
dialog:Height(height)
dialog.maxHeightSoFar = height
end
......@@ -837,31 +830,31 @@ end
local tempButtonLocs = {}; --So we don't make a new table each time.
function E:StaticPopup_Show(which, text_arg1, text_arg2, data)
local info = E.PopupDialogs[which]
if ( not info ) then
if not info then
return nil
end
if ( UnitIsDeadOrGhost('player') and not info.whileDead ) then
if ( info.OnCancel ) then
if UnitIsDeadOrGhost('player') and not info.whileDead then
if info.OnCancel then
info.OnCancel()
end
return nil
end
if ( InCinematic() and not info.interruptCinematic ) then
if ( info.OnCancel ) then
if InCinematic() and not info.interruptCinematic then
if info.OnCancel then
info.OnCancel()
end
return nil
end
if ( info.cancels ) then
if info.cancels then
for index = 1, MAX_STATIC_POPUPS, 1 do
local frame = _G['ElvUI_StaticPopup'..index]
if ( frame:IsShown() and (frame.which == info.cancels) ) then
if frame:IsShown() and (frame.which == info.cancels) then
frame:Hide()
local OnCancel = E.PopupDialogs[frame.which].OnCancel
if ( OnCancel ) then
if OnCancel then
OnCancel(frame, frame.data, 'override')
end
end
......@@ -870,42 +863,42 @@ function E:StaticPopup_Show(which, text_arg1, text_arg2, data)
-- Pick a free dialog to use, find an open dialog of the requested type
local dialog = E:StaticPopup_FindVisible(which, data)
if ( dialog ) then
if ( not info.noCancelOnReuse ) then
if dialog then
if not info.noCancelOnReuse then
local OnCancel = info.OnCancel
if ( OnCancel ) then
if OnCancel then
OnCancel(dialog, dialog.data, 'override')
end
end
dialog:Hide()
end
if ( not dialog ) then
if not dialog then
-- Find a free dialog
local index = 1
if ( info.preferredIndex ) then
if info.preferredIndex then
index = info.preferredIndex
end
for i = index, MAX_STATIC_POPUPS do
local frame = _G['ElvUI_StaticPopup'..i]
if ( frame and not frame:IsShown() ) then
if frame and not frame:IsShown() then
dialog = frame
break
end
end
--If dialog not found and there's a preferredIndex then try to find an available frame before the preferredIndex
if ( not dialog and info.preferredIndex ) then
if not dialog and info.preferredIndex then