Commit d6f9b8d7 authored by Blazeflack's avatar Blazeflack

Merge branch 'development'

# Conflicts:
#	CHANGELOG.md
parents c52216c9 cb75749a
## Interface: 80100
## Author: Elv
## Version: 10.85
## Version: 10.86
## Title: |cfffe7b2cElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB
......@@ -12,9 +12,9 @@
developer\load_developer.xml
Libraries\Load_Libraries.xml
init.lua
locales\load_locales.xml
media\load_media.xml
init.lua
Settings\Load_Config.xml
core\load_core.xml
layout\load_layout.xml
......
......@@ -2,7 +2,7 @@ ElvUI License
Copyright ©2009-2019 The contents of this addon, excluding third-party resources, are
copyrighted to their authors with all rights reserved.
The author of this addon hereby grants you the following rights:
This addon is free to use and the authors hereby grants you the following rights:
1. You may make modifications to this addon for private use only, you
may not publicize any portion of this addon. The only exception being you may
......
Copyright (c) 2007, Ace3 Development Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Redistribution of a stand alone version is strictly prohibited without
prior written authorization from the Lead of the Ace3 Development Team.
* Neither the name of the Ace3 Development Team nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
--[[
Copyright (c) 2010-2017, Hendrik "nevcairiel" Leppkes <h.leppkes@gmail.com>
Copyright (c) 2010-2019, Hendrik "nevcairiel" Leppkes <h.leppkes@gmail.com>
All rights reserved.
......@@ -26,7 +26,6 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
local MAJOR_VERSION = "LibActionButton-1.0-ElvUI"
......@@ -36,31 +35,21 @@ if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
if not lib then return end
-- Lua functions
local _G = _G
local type, error, tostring, tonumber, assert, select = type, error, tostring, tonumber, assert, select
local setmetatable, wipe, unpack, pairs, next = setmetatable, wipe, unpack, pairs, next
local str_match, format, tinsert, tremove = string.match, format, tinsert, tremove
local C_ToyBox = C_ToyBox
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
-- List them here for Mikk's FindGlobals script
-- Note: No WoW API function get upvalued to allow proper interaction with any addons that try to hook them.
-- GLOBALS: LibStub, CreateFrame, InCombatLockdown, ClearCursor, GetCursorInfo, GameTooltip, GameTooltip_SetDefaultAnchor
-- GLOBALS: GetBindingKey, GetBindingText, SetBinding, SetBindingClick, GetCVar, GetMacroInfo
-- GLOBALS: PickupAction, PickupItem, PickupMacro, PickupPetAction, PickupSpell, PickupCompanion, PickupEquipmentSet
-- GLOBALS: CooldownFrame_SetTimer, UIParent, IsSpellOverlayed, SpellFlyout, GetMouseFocus, SetClampedTextureRotation
-- GLOBALS: GetActionInfo, GetActionTexture, HasAction, GetActionText, GetActionCount, GetActionCooldown, IsAttackAction
-- GLOBALS: IsAutoRepeatAction, IsEquippedAction, IsCurrentAction, IsConsumableAction, IsUsableAction, IsStackableAction, IsActionInRange
-- GLOBALS: GetSpellLink, GetMacroSpell, GetSpellTexture, GetSpellCount, GetSpellCooldown, IsAttackSpell, IsCurrentSpell
-- GLOBALS: FindSpellBookSlotBySpellID, IsUsableSpell, IsConsumableSpell, IsSpellInRange, IsAutoRepeatSpell
-- GLOBALS: GetItemIcon, GetItemCount, GetItemCooldown, IsEquippedItem, IsCurrentItem, IsUsableItem, IsConsumableItem, IsItemInRange
-- GLOBALS: GetActionCharges, IsItemAction, GetSpellCharges
-- GLOBALS: RANGE_INDICATOR, ATTACK_BUTTON_FLASH_TIME, TOOLTIP_UPDATE_TIME
-- GLOBALS: ZoneAbilityFrame, HasZoneAbility, GetLastZoneAbilitySpellTexture
-- GLOBALS: GetCVarBool, IsAltKeyDown, IsControlKeyDown, IsShiftKeyDown, COOLDOWN_TYPE_NORMAL, COOLDOWN_TYPE_LOSS_OF_CONTROL
-- GLOBALS: GetSpellInfo, FlyoutHasSpell, GetModifiedClick, GetActionLossOfControlCooldown, CooldownFrame_Set
-- GLOBALS: ATTACK_BUTTON_FLASH_TIME, C_ToyBox, ClearCursor, COOLDOWN_TYPE_LOSS_OF_CONTROL, COOLDOWN_TYPE_NORMAL
-- GLOBALS: CooldownFrame_Set, CreateFrame, FindSpellBookSlotBySpellID, FlyoutHasSpell, GameTooltip, GameTooltip_SetDefaultAnchor
-- GLOBALS: GetActionCharges, GetActionCooldown, GetActionCount, GetActionInfo, GetActionLossOfControlCooldown, GetActionText
-- GLOBALS: GetActionTexture, GetBindingKey, GetBindingText, GetCursorInfo, GetCVar, GetCVarBool, GetItemCooldown, GetItemCount
-- GLOBALS: GetItemIcon, GetLastZoneAbilitySpellTexture, GetMacroInfo, GetMacroSpell, GetModifiedClick, GetMouseFocus, GetSpellCharges
-- GLOBALS: GetSpellCooldown, GetSpellCount, GetSpellInfo, GetSpellTexture, HasAction, HasZoneAbility, InCombatLockdown, IsActionInRange
-- GLOBALS: IsAltKeyDown, IsAttackAction, IsAttackSpell, IsAutoRepeatAction, IsAutoRepeatSpell, IsConsumableAction, IsConsumableItem
-- GLOBALS: IsConsumableSpell, IsControlKeyDown, IsCurrentAction, IsCurrentItem, IsCurrentSpell, IsEquippedAction, IsEquippedItem
-- GLOBALS: IsItemAction, IsItemInRange, IsShiftKeyDown, IsSpellInRange, IsSpellOverlayed, IsStackableAction, IsUsableAction, IsUsableItem
-- GLOBALS: IsUsableSpell, LibStub, PickupAction, PickupCompanion, PickupEquipmentSet, PickupItem, PickupMacro, PickupPetAction, PickupSpell
-- GLOBALS: RANGE_INDICATOR, SetBinding, SetBindingClick, SetClampedTextureRotation, SpellFlyout, TOOLTIP_UPDATE_TIME, UIParent, ZoneAbilityFrame
local KeyBound = LibStub("LibKeyBound-1.0", true)
local CBH = LibStub("CallbackHandler-1.0")
......
......@@ -6,37 +6,26 @@ Description: A library to encode and decode Base64 strings
License: MIT
]]
local LibBase64 = LibStub:NewLibrary("LibBase64-1.0-ElvUI", 1)
if not LibBase64 then
return
end
local MAJOR, MINOR = 'LibBase64-1.0-ElvUI', 2
local LibBase64 = LibStub:NewLibrary(MAJOR, MINOR)
if not LibBase64 then return end
local wipe, type, error, format, strsub, strchar, strbyte, tconcat = wipe, type, error, format, strsub, strchar, strbyte, table.concat
local _chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
local byteToNum = {}
local numToChar = {}
local byteToNum, numToChar = {}, {}
for i = 1, #_chars do
numToChar[i - 1] = _chars:sub(i, i)
byteToNum[_chars:byte(i)] = i - 1
numToChar[i - 1] = strsub(_chars, i, i)
byteToNum[strbyte(_chars, i)] = i - 1
end
_chars = nil
local A_byte = ("A"):byte()
local Z_byte = ("Z"):byte()
local a_byte = ("a"):byte()
local z_byte = ("z"):byte()
local zero_byte = ("0"):byte()
local nine_byte = ("9"):byte()
local plus_byte = ("+"):byte()
local slash_byte = ("/"):byte()
local equals_byte = ("="):byte()
local whitespace = {
[(" "):byte()] = true,
[("\t"):byte()] = true,
[("\n"):byte()] = true,
[("\r"):byte()] = true,
}
local t = {}
local equals_byte = strbyte("=")
local whitespace = {
[strbyte(" ")] = true,
[strbyte("\t")] = true,
[strbyte("\n")] = true,
[strbyte("\r")] = true,
}
--- Encode a normal bytestring into a Base64-encoded string
-- @param text a bytestring, can be binary data
......@@ -45,70 +34,56 @@ local t = {}
-- @usage LibBase64.Encode("Hello, how are you doing today?") == "SGVsbG8sIGhvdyBhcmUgeW91IGRvaW5nIHRvZGF5Pw=="
-- @return a Base64-encoded string
function LibBase64:Encode(text, maxLineLength, lineEnding)
if type(text) ~= "string" then
error(("Bad argument #1 to `Encode'. Expected %q, got %q"):format("string", type(text)), 2)
end
if maxLineLength == nil then
-- do nothing
elseif type(maxLineLength) ~= "number" then
error(("Bad argument #2 to `Encode'. Expected %q or %q, got %q"):format("number", "nil", type(maxLineLength)), 2)
elseif (maxLineLength % 4) ~= 0 then
error(("Bad argument #2 to `Encode'. Expected a multiple of 4, got %s"):format(maxLineLength), 2)
elseif maxLineLength <= 0 then
error(("Bad argument #2 to `Encode'. Expected a number > 0, got %s"):format(maxLineLength), 2)
end
if lineEnding == nil then
lineEnding = "\r\n"
elseif type(lineEnding) ~= "string" then
error(("Bad argument #3 to `Encode'. Expected %q, got %q"):format("string", type(lineEnding)), 2)
end
local currentLength = 0
if type(text) ~= "string" then
error(format("Bad argument #1 to `Encode'. Expected string, got %q", type(text)), 2)
end
if maxLineLength then
if type(maxLineLength) ~= "number" then
error(format("Bad argument #2 to `Encode'. Expected number or nil, got %q", type(maxLineLength)), 2)
elseif (maxLineLength % 4) ~= 0 then
error(format("Bad argument #2 to `Encode'. Expected a multiple of 4, got %s", maxLineLength), 2)
elseif maxLineLength <= 0 then
error(format("Bad argument #2 to `Encode'. Expected a number > 0, got %s", maxLineLength), 2)
end
end
if lineEnding == nil then
lineEnding = "\r\n"
elseif type(lineEnding) ~= "string" then
error(format("Bad argument #3 to `Encode'. Expected string, got %q", type(lineEnding)), 2)
end
local currentLength = 0
for i = 1, #text, 3 do
local a, b, c = text:byte(i, i+2)
local a, b, c = strbyte(text, i, i+2)
local nilNum = 0
if not b then
nilNum = 2
b = 0
c = 0
nilNum, b, c = 2, 0, 0
elseif not c then
nilNum = 1
c = 0
nilNum, c = 1, 0
end
local num = a * 2^16 + b * 2^8 + c
local d = num % 2^6
num = (num - d) / 2^6
local c = num % 2^6
num = (num - c) / 2^6
local b = num % 2^6
num = (num - b) / 2^6
local a = num % 2^6
local num = a * 2^16 + b * 2^8 + c
local d = num % 2^6;num = (num - d) / 2^6
c = num % 2^6;num = (num - c) / 2^6
b = num % 2^6;num = (num - b) / 2^6
a = num % 2^6
t[#t+1] = numToChar[a]
t[#t+1] = numToChar[b]
t[#t+1] = (nilNum >= 2) and "=" or numToChar[c]
t[#t+1] = (nilNum >= 1) and "=" or numToChar[d]
currentLength = currentLength + 4
if maxLineLength and (currentLength % maxLineLength) == 0 then
t[#t+1] = lineEnding
t[#t+1] = lineEnding
end
end
local s = table.concat(t)
for i = 1, #t do
t[i] = nil
end
local s = tconcat(t)
wipe(t)
return s
end
......@@ -121,75 +96,54 @@ local t2 = {}
-- @usage LibBase64.Encode("SGVsbG8sIGhvdyBhcmUgeW91IGRvaW5nIHRvZGF5Pw==") == "Hello, how are you doing today?"
-- @return a bytestring
function LibBase64:Decode(text)
if type(text) ~= "string" then
error(("Bad argument #1 to `Decode'. Expected %q, got %q"):format("string", type(text)), 2)
end
for i = 1, #text do
local byte = text:byte(i)
if whitespace[byte] or byte == equals_byte then
-- do nothing
else
local num = byteToNum[byte]
if not num then
for i = 1, #t2 do
t2[k] = nil
end
error(("Bad argument #1 to `Decode'. Received an invalid char: %q"):format(text:sub(i, i)), 2)
end
t2[#t2+1] = num
end
end
for i = 1, #t2, 4 do
local a, b, c, d = t2[i], t2[i+1], t2[i+2], t2[i+3]
if type(text) ~= "string" then
error(format("Bad argument #1 to `Decode'. Expected string, got %q", type(text)), 2)
end
for i = 1, #text do
local byte = strbyte(text, i)
if not (whitespace[byte] or byte == equals_byte) then
local num = byteToNum[byte]
if not num then
wipe(t2)
error(format("Bad argument #1 to `Decode'. Received an invalid char: %q", strsub(text, i, i)), 2)
end
t2[#t2+1] = num
end
end
for i = 1, #t2, 4 do
local a, b, c, d = t2[i], t2[i+1], t2[i+2], t2[i+3]
local nilNum = 0
if not c then
nilNum = 2
c = 0
d = 0
nilNum, c, d = 2, 0, 0
elseif not d then
nilNum = 1
d = 0
nilNum, d = 1, 0
end
local num = a * 2^18 + b * 2^12 + c * 2^6 + d
c = num % 2^8;num = (num - c) / 2^8
b = num % 2^8;num = (num - b) / 2^8
a = num % 2^8
local c = num % 2^8
num = (num - c) / 2^8
local b = num % 2^8
num = (num - b) / 2^8
local a = num % 2^8
t[#t+1] = string.char(a)
if nilNum < 2 then
t[#t+1] = string.char(b)
end
if nilNum < 1 then
t[#t+1] = string.char(c)
end
t[#t+1] = strchar(a)
if nilNum < 2 then t[#t+1] = strchar(b) end
if nilNum < 1 then t[#t+1] = strchar(c) end
end
for i = 1, #t2 do
t2[i] = nil
end
wipe(t2)
local s = table.concat(t)
for i = 1, #t do
t[i] = nil
end
local s = tconcat(t)
wipe(t)
return s
end
function LibBase64:IsBase64(text)
if type(text) ~= "string" then
error(("Bad argument #1 to `IsBase64'. Expected %q, got %q"):format("string", type(text)), 2)
error(format("Bad argument #1 to `IsBase64'. Expected string, got %q", type(text)), 2)
end
if #text % 4 ~= 0 then
......@@ -197,10 +151,8 @@ function LibBase64:IsBase64(text)
end
for i = 1, #text do
local byte = text:byte(i)
if whitespace[byte] or byte == equals_byte then
-- do nothing
else
local byte = strbyte(text, i)
if not (whitespace[byte] or byte == equals_byte) then
local num = byteToNum[byte]
if not num then
return false
......
......@@ -209,7 +209,7 @@ function lib:GeneratePluginList()
list = list..Pname
if author then list = list..' '..INFO_BY..' '..author end
list = list..color..(plugin.isLib and ' '..LIBRARY or ' - '..INFO_VERSION..' '..plugin.version)
if plugin.old then list = list..INFO_NEW..plugin.newversion..')' end
if plugin.old then list = list..' ('..INFO_NEW..plugin.newversion..')' end
list = list..'|r\n'
end
end
......
......@@ -24,8 +24,8 @@ function Lib:Tooltip(link, search)
return link and self.Filters.tip:match(link, nil, search)
end
function Lib:TooltipPhrase(link, search, allowPartialMatch)
return link and self.Filters.tipPhrases:match(link, nil, search, allowPartialMatch)
function Lib:TooltipPhrase(link, search)
return link and self.Filters.tipPhrases:match(link, nil, search)
end
function Lib:InSet(link, search)
......@@ -240,6 +240,20 @@ Lib.Filters.azerite = {
end
}
Lib.Filters.keystone = {
keyword1 = CHALLENGES:lower(), --English: "mythic keystone" (localized)
keyword2 = "mythic keystone", --unlocalized
canSearch = function(self, operator, search)
return not operator and self.keyword1:find(search) or self.keyword2:find(search)
end,
match = function(self, link)
local id = link:match('item:(%d+)')
return id and (select(12, GetItemInfo(id)) == 5 and select(13, GetItemInfo(id)) == 1) --itemClassID 5 and itemSubClassID 1 which translates to "Keystone"
end
}
--[[ Tooltips ]]--
Lib.Filters.tip = {
......@@ -325,10 +339,16 @@ Lib.Filters.tipPhrases = {
[FOLLOWERLIST_LABEL_CHAMPIONS:lower()] = Lib:TooltipLine('item:147556', 2),
[GARRISON_FOLLOWERS:lower()] = Lib:TooltipLine('item:147556', 2),
['soulbound'] = ITEM_BIND_ON_PICKUP,
['bound'] = ITEM_BIND_ON_PICKUP,
['bop'] = ITEM_BIND_ON_PICKUP,
['boe'] = ITEM_BIND_ON_EQUIP,
['bou'] = ITEM_BIND_ON_USE,
['boa'] = ITEM_BIND_TO_BNETACCOUNT,
['quests'] = ITEM_BIND_QUEST,
['crafting reagent'] = PROFESSIONS_USED_IN_COOKING,
['toy'] = TOY,
['champions'] = Lib:TooltipLine('item:147556', 2),
['followers'] = Lib:TooltipLine('item:147556', 2),
}
}
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file="LibStub\LibStub.lua"/>
<Script file="CallbackHandler-1.0\CallbackHandler-1.0.lua"/>
<Script file="Ace3\LibStub\LibStub.lua"/>
<Script file="Ace3\CallbackHandler-1.0\CallbackHandler-1.0.lua"/>
<Include file="Ace3\AceAddon-3.0\AceAddon-3.0.xml"/>
<Include file="Ace3\AceEvent-3.0\AceEvent-3.0.xml"/>
<Include file="Ace3\AceConsole-3.0\AceConsole-3.0.xml"/>
<Include file="Ace3\AceDB-3.0\AceDB-3.0.xml"/>
<Include file="Ace3\AceLocale-3.0\AceLocale-3.0.xml"/>
<Include file="Ace3\AceComm-3.0\AceComm-3.0.xml"/>
<Include file="Ace3\AceSerializer-3.0\AceSerializer-3.0.xml"/>
<Include file="Ace3\AceTimer-3.0\AceTimer-3.0.xml"/>
<Include file="Ace3\AceHook-3.0\AceHook-3.0.xml"/>
<Include file="LibSpellRange-1.0\lib.xml"/>
<Include file="AceAddon-3.0\AceAddon-3.0.xml"/>
<Include file="AceEvent-3.0\AceEvent-3.0.xml"/>
<Include file="AceConsole-3.0\AceConsole-3.0.xml"/>
<Include file="AceDB-3.0\AceDB-3.0.xml"/>
<Include file="AceLocale-3.0\AceLocale-3.0.xml"/>
<Include file="AceComm-3.0\AceComm-3.0.xml"/>
<Include file="AceSerializer-3.0\AceSerializer-3.0.xml"/>
<Include file="AceTimer-3.0\AceTimer-3.0.xml"/>
<Include file="AceHook-3.0\AceHook-3.0.xml"/>
<Include file="LibSharedMedia-3.0\lib.xml"/>
<Script file="LibSimpleSticky\LibSimpleSticky.lua"/>
<Include file='oUF\oUF.xml'/>
<Include file='oUF_Custom\oUF_Custom.xml'/>
<Include file='oUF_Plugins\oUF_Plugins.xml'/>
<Include file="LibActionButton-1.0\LibActionButton-1.0.xml"/>
<Script file="LibDataBroker\LibDataBroker-1.1.lua"/>
......
......@@ -123,7 +123,7 @@ local function Update(self, event, unit, powertype)
* max - the maximum value of the player's additional power (number)
--]]
if(element.PostUpdate) then
return element:PostUpdate(unit, cur, max, event) -- ElvUI adds event
return element:PostUpdate(unit, cur, max)
end
end
......@@ -145,14 +145,6 @@ local function ElementEnable(self)
self.AdditionalPower:Show()
-- ElvUI block
if self.AdditionalPower.PostUpdateVisibility then
self.AdditionalPower:PostUpdateVisibility(true, not self.AdditionalPower.isEnabled)
end
self.AdditionalPower.isEnabled = true
-- end block
Path(self, 'ElementEnable', 'player', ADDITIONAL_POWER_BAR_NAME)
end
......@@ -162,14 +154,6 @@ local function ElementDisable(self)
self.AdditionalPower:Hide()