Commit 9592ab03 authored by Blazeflack's avatar Blazeflack

Merge branch 'development'

# Conflicts:
#	CHANGELOG.md
#	ElvUI/LICENSE.txt
parents 065fadfb b5e504f2
## Interface: 80000
## Interface: 80100
## Author: Elv
## Version: 10.84
## Version: 10.85
## Title: |cfffe7b2cElvUI|r
## Notes: User Interface replacement AddOn for World of Warcraft.
## SavedVariables: ElvDB, ElvPrivateDB
......
ElvUI License
ElvUI License
Copyright ©2009-2019 The contents of this addon, excluding third-party resources, are
copyrighted to their authors with all rights reserved.
......
......@@ -402,7 +402,7 @@ local function eventHandler(self, event)
if event == "PLAYER_LOGIN" then
self:UnregisterEvent(event)
self:RegisterUnitEvent("PLAYER_SPECIALIZATION_CHANGED", "player")
self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
end
if lib.currentSpec > 0 and next(upgrades) then
......
......@@ -102,7 +102,8 @@ Lib.Filters.name = {
end,
match = function(self, item, _, search)
return Search:Find(search, C_Item.GetItemNameByID(item))
-- Modified: C_Item.GetItemNameByID returns nil for M+ keystones, a fallback is needed
return Search:Find(search, C_Item.GetItemNameByID(item) or item:match('%[(.-)%]'))
end
}
......@@ -166,7 +167,7 @@ Lib.Filters.quality = {
keywords = {},
canSearch = function(self, _, search)
for quality, name in pairs(qualities) do
for quality, name in pairs(self.keywords) do
if name:find(search) then
return quality
end
......@@ -285,7 +286,7 @@ Lib.Filters.tipPhrases = {
end
end,
match = function(self, link, _, search, allowPartialMatch)
match = function(self, link, _, search)
local id = link:match('item:(%d+)')
if not id then
return
......@@ -303,7 +304,7 @@ Lib.Filters.tipPhrases = {
for i = 1, Lib.Scanner:NumLines() do
local text = _G[Lib.Scanner:GetName() .. 'TextLeft' .. i]:GetText()
text = CleanString(text)
if search == text or (allowPartialMatch and text:find(search)) then
if search == text then
matches = true
break
end
......
Copyright (c) 2006-2018 Trond A Ekseth <troeks@gmail.com>
Copyright (c) 2016-2018 Val Voronov <i.lightspark@gmail.com>
Copyright (c) 2016-2018 Adrian L Lange <contact@p3lim.net>
Copyright (c) 2016-2018 Rainrider <rainrider.wow@gmail.com>
Copyright (c) 2006-2019 Trond A Ekseth <troeks@gmail.com>
Copyright (c) 2016-2019 Val Voronov <i.lightspark@gmail.com>
Copyright (c) 2016-2019 Adrian L Lange <contact@p3lim.net>
Copyright (c) 2016-2019 Rainrider <rainrider.wow@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
......
......@@ -27,6 +27,7 @@ local oUF = ns.oUF
local function Update(self, event)
local element = self.AssistantIndicator
local unit = self.unit
--[[ Callback: AssistantIndicator:PreUpdate()
Called before the element has been updated.
......@@ -37,7 +38,6 @@ local function Update(self, event)
element:PreUpdate()
end
local unit = self.unit
local isAssistant = UnitInRaid(unit) and UnitIsGroupAssistant(unit) and not UnitIsGroupLeader(unit)
if(isAssistant) then
element:Show()
......
......@@ -97,7 +97,7 @@ local function Disable(self)
element:Hide()
self:UnregisterEvent('PLAYER_ROLES_ASSIGNED', Path)
self:UnregisterEvent('GROUP_ROSTER_UPDATE', Path)
self:UnregisterEvent('GROUP_ROSTER_UPDATE', Path, true)
end
end
......
......@@ -77,18 +77,10 @@ The following options are listed by priority. The first check that returns true
local _, ns = ...
local oUF = ns.oUF
local updateFrequentUpdates -- ElvUI
local function UpdateColor(element, unit, cur, max)
local parent = element.__owner
-- ElvUI block
if element.frequentUpdates ~= element.__frequentUpdates then
element.__frequentUpdates = element.frequentUpdates
updateFrequentUpdates(parent)
end
-- end block
local r, g, b, t
if(element.colorTapping and not UnitPlayerControlled(unit) and UnitIsTapDenied(unit)) then
t = parent.colors.tapped
......@@ -186,38 +178,31 @@ local function ForceUpdate(element)
return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
end
-- ElvUI block
function updateFrequentUpdates(self)
local health = self.Health
if health.frequentUpdates and not self:IsEventRegistered("UNIT_HEALTH_FREQUENT") then
if GetCVarBool("predictedHealth") ~= true then
SetCVar("predictedHealth", "1")
end
--[[ Health:SetFrequentUpdates(state)
Used to toggle frequent updates.
self:RegisterEvent('UNIT_HEALTH_FREQUENT', Path)
if self:IsEventRegistered("UNIT_HEALTH") then
self:UnregisterEvent("UNIT_HEALTH", Path)
end
elseif not self:IsEventRegistered("UNIT_HEALTH") then
self:RegisterEvent('UNIT_HEALTH', Path)
if self:IsEventRegistered("UNIT_HEALTH_FREQUENT") then
self:UnregisterEvent("UNIT_HEALTH_FREQUENT", Path)
* self - the Health element
* state - the desired state of frequent updates (boolean)
--]]
local function SetFrequentUpdates(element, state)
if(element.frequentUpdates ~= state) then
element.frequentUpdates = state
if(element.frequentUpdates) then
element.__owner:UnregisterEvent('UNIT_HEALTH', Path)
element.__owner:RegisterEvent('UNIT_HEALTH_FREQUENT', Path)
else
element.__owner:UnregisterEvent('UNIT_HEALTH_FREQUENT', Path)
element.__owner:RegisterEvent('UNIT_HEALTH', Path)
end
end
end
-- end block
local function Enable(self, unit)
local element = self.Health
if(element) then
element.__owner = self
element.ForceUpdate = ForceUpdate
-- ElvUI block
element.__frequentUpdates = element.frequentUpdates
updateFrequentUpdates(self)
-- end block
element.SetFrequentUpdates = SetFrequentUpdates
if(element.frequentUpdates) then
self:RegisterEvent('UNIT_HEALTH_FREQUENT', Path)
......
......@@ -27,6 +27,7 @@ local oUF = ns.oUF
local function Update(self, event)
local element = self.LeaderIndicator
local unit = self.unit
--[[ Callback: LeaderIndicator:PreUpdate()
Called before the element has been updated.
......@@ -37,7 +38,6 @@ local function Update(self, event)
element:PreUpdate()
end
local unit = self.unit
local isLeader = (UnitInParty(unit) or UnitInRaid(unit)) and UnitIsGroupLeader(unit)
if(isLeader) then
element:Show()
......
......@@ -25,7 +25,9 @@ A default texture will be applied if the widget is a Texture and doesn't have a
local _, ns = ...
local oUF = ns.oUF
local function Update(self, event)
local function Update(self, event, unit)
if(self.unit ~= unit) then return end
local element = self.PhaseIndicator
--[[ Callback: PhaseIndicator:PreUpdate()
......@@ -37,8 +39,8 @@ local function Update(self, event)
element:PreUpdate()
end
local isInSamePhase = UnitInPhase(self.unit) and not UnitIsWarModePhased(self.unit)
if(not isInSamePhase and UnitIsPlayer(self.unit) and UnitIsConnected(self.unit)) then
local isInSamePhase = UnitInPhase(unit) and not UnitIsWarModePhased(unit)
if(not isInSamePhase and UnitIsPlayer(unit) and UnitIsConnected(unit)) then
element:Show()
else
element:Hide()
......@@ -67,7 +69,7 @@ local function Path(self, ...)
end
local function ForceUpdate(element)
return Path(element.__owner, 'ForceUpdate')
return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
end
local function Enable(self)
......@@ -76,7 +78,7 @@ local function Enable(self)
element.__owner = self
element.ForceUpdate = ForceUpdate
self:RegisterEvent('UNIT_PHASE', Path, true)
self:RegisterEvent('UNIT_PHASE', Path)
if(element:IsObjectType('Texture') and not element:GetTexture()) then
element:SetTexture([[Interface\TargetingFrame\UI-PhasingIcon]])
......
......@@ -110,7 +110,7 @@ local function Enable(self, unit)
self:RegisterEvent('UNIT_MODEL_CHANGED', Path)
self:RegisterEvent('UNIT_PORTRAIT_UPDATE', Path)
self:RegisterEvent('PORTRAITS_UPDATED', Path)
self:RegisterEvent('PORTRAITS_UPDATED', Path, true)
self:RegisterEvent('UNIT_CONNECTION', Path)
-- The quest log uses PARTY_MEMBER_{ENABLE,DISABLE} to handle updating of
......
......@@ -91,8 +91,6 @@ The following options are listed by priority. The first check that returns true
local _, ns = ...
local oUF = ns.oUF
local updateFrequentUpdates -- ElvUI
-- sourced from FrameXML/UnitPowerBarAlt.lua
local ALTERNATE_POWER_INDEX = Enum.PowerType.Alternate or 10
......@@ -107,13 +105,6 @@ local function UpdateColor(element, unit, cur, min, max, displayType)
local parent = element.__owner
local ptype, ptoken, altR, altG, altB = UnitPowerType(unit)
-- ElvUI block
if element.frequentUpdates ~= element.__frequentUpdates then
element.__frequentUpdates = element.frequentUpdates
updateFrequentUpdates(self)
end
-- end block
local r, g, b, t
if(element.colorTapping and element.tapped) then
t = parent.colors.tapped
......@@ -258,34 +249,31 @@ local function ForceUpdate(element)
return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
end
-- ElvUI block
function updateFrequentUpdates(self)
local power = self.Power
if power.frequentUpdates and not self:IsEventRegistered('UNIT_POWER_FREQUENT') then
self:RegisterEvent('UNIT_POWER_FREQUENT', Path)
if self:IsEventRegistered('UNIT_POWER_UPDATE') then
self:UnregisterEvent('UNIT_POWER_UPDATE', Path)
end
elseif not self:IsEventRegistered('UNIT_POWER_UPDATE') then
self:RegisterEvent('UNIT_POWER_UPDATE', Path)
--[[ Power:SetFrequentUpdates(state)
Used to toggle frequent updates.
if self:IsEventRegistered('UNIT_POWER_FREQUENT') then
self:UnregisterEvent('UNIT_POWER_FREQUENT', Path)
* self - the Power element
* state - the desired state of frequent updates (boolean)
--]]
local function SetFrequentUpdates(element, state)
if(element.frequentUpdates ~= state) then
element.frequentUpdates = state
if(element.frequentUpdates) then
element.__owner:UnregisterEvent('UNIT_POWER_UPDATE', Path)
element.__owner:RegisterEvent('UNIT_POWER_FREQUENT', Path)
else
element.__owner:UnregisterEvent('UNIT_POWER_FREQUENT', Path)
element.__owner:RegisterEvent('UNIT_POWER_UPDATE', Path)
end
end
end
-- end block
local function Enable(self)
local element = self.Power
if(element) then
element.__owner = self
element.ForceUpdate = ForceUpdate
-- ElvUI block
element.__frequentUpdates = element.frequentUpdates
updateFrequentUpdates(self)
-- end block
element.SetFrequentUpdates = SetFrequentUpdates
if(element.frequentUpdates) then
self:RegisterEvent('UNIT_POWER_FREQUENT', Path)
......
......@@ -36,9 +36,10 @@ local _, ns = ...
local oUF = ns.oUF
local function Update(self, event, unit)
if(unit ~= self.unit) then return end
if(unit and unit ~= self.unit) then return end
local element = self.PvPIndicator
unit = unit or self.unit
--[[ Callback: PvPIndicator:PreUpdate(unit)
Called before the element has been updated.
......@@ -127,7 +128,7 @@ local function Enable(self)
element.ForceUpdate = ForceUpdate
self:RegisterEvent('UNIT_FACTION', Path)
self:RegisterEvent('HONOR_LEVEL_UPDATE', Path)
self:RegisterEvent('HONOR_LEVEL_UPDATE', Path, true)
return true
end
......
......@@ -29,9 +29,8 @@ local MAINTANK_ICON = [[Interface\GROUPFRAME\UI-GROUP-MAINTANKICON]]
local MAINASSIST_ICON = [[Interface\GROUPFRAME\UI-GROUP-MAINASSISTICON]]
local function Update(self, event)
local unit = self.unit
local element = self.RaidRoleIndicator
local unit = self.unit
--[[ Callback: RaidRoleIndicator:PreUpdate()
Called before the element has been updated.
......
......@@ -58,6 +58,7 @@ end
local function Update(self, event)
local element = self.ReadyCheckIndicator
local unit = self.unit
--[[ Callback: ReadyCheckIndicator:PreUpdate()
Called before the element has been updated.
......@@ -68,7 +69,6 @@ local function Update(self, event)
element:PreUpdate()
end
local unit = self.unit
local status = GetReadyCheckStatus(unit)
if(UnitExists(unit) and status) then
if(status == 'ready') then
......@@ -122,7 +122,8 @@ end
local function Enable(self, unit)
local element = self.ReadyCheckIndicator
if(element and (unit and (unit:sub(1, 5) == 'party' or unit:sub(1,4) == 'raid'))) then
unit = unit and unit:match('(%a+)%d*$')
if(element and (unit == 'party' or unit == 'raid')) then
element.__owner = self
element.ForceUpdate = ForceUpdate
......
......@@ -25,7 +25,9 @@ A default texture will be applied if the widget is a Texture and doesn't have a
local _, ns = ...
local oUF = ns.oUF
local function Update(self, event)
local function Update(self, event, unit)
if(self.unit ~= unit) then return end
local element = self.ResurrectIndicator
--[[ Callback: ResurrectIndicator:PreUpdate()
......@@ -37,7 +39,7 @@ local function Update(self, event)
element:PreUpdate()
end
local incomingResurrect = UnitHasIncomingResurrection(self.unit)
local incomingResurrect = UnitHasIncomingResurrection(unit)
if(incomingResurrect) then
element:Show()
else
......@@ -67,7 +69,7 @@ local function Path(self, ...)
end
local function ForceUpdate(element)
return Path(element.__owner, 'ForceUpdate')
return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
end
local function Enable(self)
......
......@@ -175,6 +175,7 @@ local function Path(self, event, ...)
end
-- ElvUI block
local VisibilityPath
local function RunesEnable(self)
self:RegisterEvent('UNIT_ENTERED_VEHICLE', VisibilityPath)
self:UnregisterEvent("UNIT_EXITED_VEHICLE", VisibilityPath)
......@@ -223,7 +224,7 @@ local function Visibility(self, event, ...)
end
end
local VisibilityPath = function(self, ...)
VisibilityPath = function(self, ...)
return (self.Runes.OverrideVisibility or Visibility) (self, ...)
end
-- end block
......@@ -247,7 +248,7 @@ local function Enable(self, unit)
end
end
self:RegisterEvent('PLAYER_SPECIALIZATION_CHANGED', Path, true)
self:RegisterEvent('PLAYER_SPECIALIZATION_CHANGED', Path)
self:RegisterEvent('RUNE_POWER_UPDATE', Path, true)
return true
......
--[[
# Element: SummonIndicator
Handles the visibility and updating of an indicator based on the unit's incoming summon status.
## Widget
SummonIndicator - A `Texture` used to display if the unit has an incoming summon.
## Notes
This element updates by changing the texture.
## Examples
-- Position and size
local SummonIndicator = self:CreateTexture(nil, 'OVERLAY')
SummonIndicator:SetSize(32, 32)
SummonIndicator:SetPoint('TOPRIGHT', self)
-- Register it with oUF
self.SummonIndicator = SummonIndicator
--]]
local _, ns = ...
local oUF = ns.oUF
-- sourced from Blizzard_APIDocumentation/IncomingSummonDocumentation.lua
local SUMMON_STATUS_NONE = Enum.SummonStatus.None or 0
local SUMMON_STATUS_PENDING = Enum.SummonStatus.Pending or 1
local SUMMON_STATUS_ACCEPTED = Enum.SummonStatus.Accepted or 2
local SUMMON_STATUS_DECLINED = Enum.SummonStatus.Declined or 3
local function Update(self, event, unit)
if(self.unit ~= unit) then return end
local element = self.SummonIndicator
--[[ Callback: SummonIndicator:PreUpdate()
Called before the element has been updated.
* self - the SummonIndicator element
--]]
if(element.PreUpdate) then
element:PreUpdate()
end
local status = C_IncomingSummon.IncomingSummonStatus(unit)
if(status ~= SUMMON_STATUS_NONE) then
if(status == SUMMON_STATUS_PENDING) then
element:SetAtlas('Raid-Icon-SummonPending')
elseif(status == SUMMON_STATUS_ACCEPTED) then
element:SetAtlas('Raid-Icon-SummonAccepted')
elseif(status == SUMMON_STATUS_DECLINED) then
element:SetAtlas('Raid-Icon-SummonDeclined')
end
element:Show()
else
element:Hide()
end
--[[ Callback: SummonIndicator:PostUpdate(status)
Called after the element has been updated.
* self - the SummonIndicator element
* status - the unit's incoming summon status (number)[0-3]
--]]
if(element.PostUpdate) then
return element:PostUpdate(status)
end
end
local function Path(self, ...)
--[[ Override: SummonIndicator.Override(self, event)
Used to completely override the internal update function.
* self - the parent object
* event - the event triggering the update (string)
* ... - the arguments accompanying the event
--]]
return (self.SummonIndicator.Override or Update) (self, ...)
end
local function ForceUpdate(element)
return Path(element.__owner, 'ForceUpdate', element.__owner.unit)
end
local function Enable(self)
local element = self.SummonIndicator
if(element) then
element.__owner = self
element.ForceUpdate = ForceUpdate
self:RegisterEvent('INCOMING_SUMMON_CHANGED', Path)
return true
end
end
local function Disable(self)
local element = self.SummonIndicator
if(element) then
element:Hide()
self:UnregisterEvent('INCOMING_SUMMON_CHANGED', Path)
end
end
oUF:AddElement('SummonIndicator', Path, Enable, Disable)
This diff is collapsed.
......@@ -4,6 +4,7 @@ local Private = oUF.Private
local argcheck = Private.argcheck
local error = Private.error
local validateUnit = Private.validateUnit
local frame_metatable = Private.frame_metatable
-- Original event methods
......@@ -12,22 +13,24 @@ local registerUnitEvent = frame_metatable.__index.RegisterUnitEvent
local unregisterEvent = frame_metatable.__index.UnregisterEvent
local isEventRegistered = frame_metatable.__index.IsEventRegistered
local unitEvents = {}
function Private.UpdateUnits(frame, unit, realUnit)
if(unit == realUnit) then
realUnit = nil
end
if(frame.unit ~= unit or frame.realUnit ~= realUnit) then