Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Rayford
Tukui
Commits
5b648395
Commit
5b648395
authored
Jun 25, 2019
by
Tukz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update oUF
parent
140d1516
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
979 additions
and
525 deletions
+979
-525
Tukui/Libs/oUF/.travis.yml
Tukui/Libs/oUF/.travis.yml
+1
-1
Tukui/Libs/oUF/LICENSE
Tukui/Libs/oUF/LICENSE
+4
-4
Tukui/Libs/oUF/blizzard.lua
Tukui/Libs/oUF/blizzard.lua
+11
-4
Tukui/Libs/oUF/colors.lua
Tukui/Libs/oUF/colors.lua
+32
-38
Tukui/Libs/oUF/elements/additionalpower.lua
Tukui/Libs/oUF/elements/additionalpower.lua
+1
-1
Tukui/Libs/oUF/elements/alternativepower.lua
Tukui/Libs/oUF/elements/alternativepower.lua
+0
-2
Tukui/Libs/oUF/elements/assistantindicator.lua
Tukui/Libs/oUF/elements/assistantindicator.lua
+1
-1
Tukui/Libs/oUF/elements/castbar.lua
Tukui/Libs/oUF/elements/castbar.lua
+0
-2
Tukui/Libs/oUF/elements/classpower.lua
Tukui/Libs/oUF/elements/classpower.lua
+5
-14
Tukui/Libs/oUF/elements/grouproleindicator.lua
Tukui/Libs/oUF/elements/grouproleindicator.lua
+1
-1
Tukui/Libs/oUF/elements/health.lua
Tukui/Libs/oUF/elements/health.lua
+36
-3
Tukui/Libs/oUF/elements/leaderindicator.lua
Tukui/Libs/oUF/elements/leaderindicator.lua
+1
-1
Tukui/Libs/oUF/elements/phaseindicator.lua
Tukui/Libs/oUF/elements/phaseindicator.lua
+7
-5
Tukui/Libs/oUF/elements/portrait.lua
Tukui/Libs/oUF/elements/portrait.lua
+1
-1
Tukui/Libs/oUF/elements/power.lua
Tukui/Libs/oUF/elements/power.lua
+42
-9
Tukui/Libs/oUF/elements/powerprediction.lua
Tukui/Libs/oUF/elements/powerprediction.lua
+2
-3
Tukui/Libs/oUF/elements/pvpclassificationindicator.lua
Tukui/Libs/oUF/elements/pvpclassificationindicator.lua
+119
-0
Tukui/Libs/oUF/elements/pvpindicator.lua
Tukui/Libs/oUF/elements/pvpindicator.lua
+3
-2
Tukui/Libs/oUF/elements/raidroleindicator.lua
Tukui/Libs/oUF/elements/raidroleindicator.lua
+1
-2
Tukui/Libs/oUF/elements/readycheckindicator.lua
Tukui/Libs/oUF/elements/readycheckindicator.lua
+5
-4
Tukui/Libs/oUF/elements/resurrectindicator.lua
Tukui/Libs/oUF/elements/resurrectindicator.lua
+5
-3
Tukui/Libs/oUF/elements/runes.lua
Tukui/Libs/oUF/elements/runes.lua
+3
-2
Tukui/Libs/oUF/elements/summonindicator.lua
Tukui/Libs/oUF/elements/summonindicator.lua
+110
-0
Tukui/Libs/oUF/elements/tags.lua
Tukui/Libs/oUF/elements/tags.lua
+369
-314
Tukui/Libs/oUF/elements/threatindicator.lua
Tukui/Libs/oUF/elements/threatindicator.lua
+4
-5
Tukui/Libs/oUF/events.lua
Tukui/Libs/oUF/events.lua
+82
-47
Tukui/Libs/oUF/oUF.toc
Tukui/Libs/oUF/oUF.toc
+1
-1
Tukui/Libs/oUF/oUF.xml
Tukui/Libs/oUF/oUF.xml
+22
-30
Tukui/Libs/oUF/ouf.lua
Tukui/Libs/oUF/ouf.lua
+68
-20
Tukui/Libs/oUF/private.lua
Tukui/Libs/oUF/private.lua
+38
-1
Tukui/Libs/oUF/units.lua
Tukui/Libs/oUF/units.lua
+4
-4
No files found.
Tukui/Libs/oUF/.travis.yml
View file @
5b648395
...
...
@@ -17,7 +17,7 @@ env:
-
secure
:
mbIhu/gxl1XmTjBArVwvsfn6BOazK/sUAl96wQmayWyOwM1ZCKqo0o6ENSxJi+rKtsguIydM6ncdla+OTjRO1ewoZdvnkeSxLFCcfWCEKciRLk836qF2lpyAFF5LiZhSmEJyVMzqpZ2/l8T5CPtEwhLaNfZ2PuMsF+UiCJlVRJ5fcPrDYx/H6mj80t01pHW7jZq8t/mFlqGVEfLe++qnozSRlKOc0UC7EypOUeIotGMbh08cGNWQlOdL6g9i+aexkX1K9SN4aXErGggjn5cn5HCHTSxzwrxc0n7tLmhooPilQbwjl5d+ssjg251t7ugUM89h/D1kPMhtkDEEp7uqjZcOQwjBSrNIX+Oc35TxzM3JpqdArZGRfyhOD3F9rCMGGHJhz4Rn+iUNrsvV28SsMW/iuc80JP/z+GXf1Qlq0IccWdR7qLH80aWbD56XpRjiQ+9BFEq+lFYV6L/nuuJjx9wa7lzba6hw5FWjkd4sLVPOA3L3sLzyaOEApfvBr+QchHOb7EeUBjxjjrq+uTh5dJ1XN/6PtfeXjjsqhBzll588WZxhIPV8hbijXhOtjl27PkZ5vMoLZYgjBoKlK1aEC0rmavvNnzktpAV5vjPV3MzmWlTqopMukZOI6ghRctfJKg83u32/MPyFpwFjlIcIPOr5b9Tf62AjhYWN2pH1dCw=
before_script
:
"
./utils/changelog
>
CHANGELOG.md"
script
:
curl -s https://raw.githubusercontent.com/
oUF-wow
/packager/master/release.sh | bash
script
:
curl -s https://raw.githubusercontent.com/
BigWigsMods
/packager/master/release.sh | bash
notifications
:
email
:
false
...
...
Tukui/Libs/oUF/LICENSE
View file @
5b648395
Copyright (c) 2006-201
8
Trond A Ekseth <troeks@gmail.com>
Copyright (c) 2016-201
8
Val Voronov <i.lightspark@gmail.com>
Copyright (c) 2016-201
8
Adrian L Lange <contact@p3lim.net>
Copyright (c) 2016-201
8
Rainrider <rainrider.wow@gmail.com>
Copyright (c) 2006-201
9
Trond A Ekseth <troeks@gmail.com>
Copyright (c) 2016-201
9
Val Voronov <i.lightspark@gmail.com>
Copyright (c) 2016-201
9
Adrian L Lange <contact@p3lim.net>
Copyright (c) 2016-201
9
Rainrider <rainrider.wow@gmail.com>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
...
...
Tukui/Libs/oUF/blizzard.lua
View file @
5b648395
...
...
@@ -14,7 +14,11 @@ local hiddenParent = CreateFrame('Frame', nil, UIParent)
hiddenParent
:
SetAllPoints
()
hiddenParent
:
Hide
()
local
function
handleFrame
(
baseName
)
local
function
insecureOnShow
(
self
)
self
:
Hide
()
end
local
function
handleFrame
(
baseName
,
doNotReparent
)
local
frame
if
(
type
(
baseName
)
==
'string'
)
then
frame
=
_G
[
baseName
]
...
...
@@ -26,8 +30,9 @@ local function handleFrame(baseName)
frame
:
UnregisterAllEvents
()
frame
:
Hide
()
-- Keep frame hidden without causing taint
frame
:
SetParent
(
hiddenParent
)
if
(
not
doNotReparent
)
then
frame
:
SetParent
(
hiddenParent
)
end
local
health
=
frame
.
healthBar
or
frame
.
healthbar
if
(
health
)
then
...
...
@@ -116,7 +121,9 @@ function oUF:DisableBlizzard(unit)
elseif
(
unit
:
match
(
'nameplate%d+$'
))
then
local
frame
=
C_NamePlate
.
GetNamePlateForUnit
(
unit
)
if
(
frame
and
frame
.
UnitFrame
)
then
handleFrame
(
frame
.
UnitFrame
)
frame
.
UnitFrame
:
HookScript
(
'OnShow'
,
insecureOnShow
)
handleFrame
(
frame
.
UnitFrame
,
true
)
end
end
end
Tukui/Libs/oUF/colors.lua
View file @
5b648395
...
...
@@ -11,13 +11,29 @@ local colors = {
0
,
1
,
0
},
health
=
{
49
/
255
,
207
/
255
,
37
/
255
},
disconnected
=
{.
6
,
.
6
,
.
6
},
tapped
=
{.
6
,
.
6
,
.
6
},
disconnected
=
{
0
.
6
,
0
.
6
,
0
.
6
},
tapped
=
{
0
.
6
,
0
.
6
,
0
.
6
},
runes
=
{
{
247
/
255
,
65
/
255
,
57
/
255
},
-- blood
{
148
/
255
,
203
/
255
,
247
/
255
},
-- frost
{
173
/
255
,
235
/
255
,
66
/
255
},
-- unholy
},
selection
=
{
[
0
]
=
{
255
/
255
,
0
/
255
,
0
/
255
},
-- HOSTILE
[
1
]
=
{
255
/
255
,
129
/
255
,
0
/
255
},
-- UNFRIENDLY
[
2
]
=
{
255
/
255
,
255
/
255
,
0
/
255
},
-- NEUTRAL
[
3
]
=
{
0
/
255
,
255
/
255
,
0
/
255
},
-- FRIENDLY
[
4
]
=
{
0
/
255
,
0
/
255
,
255
/
255
},
-- PLAYER_SIMPLE
[
5
]
=
{
96
/
255
,
96
/
255
,
255
/
255
},
-- PLAYER_EXTENDED
[
6
]
=
{
170
/
255
,
170
/
255
,
255
/
255
},
-- PARTY
[
7
]
=
{
170
/
255
,
255
/
255
,
170
/
255
},
-- PARTY_PVP
[
8
]
=
{
83
/
255
,
201
/
255
,
255
/
255
},
-- FRIEND
[
9
]
=
{
128
/
255
,
128
/
255
,
128
/
255
},
-- DEAD
-- [10] = {}, -- COMMENTATOR_TEAM_1, unavailable to players
-- [11] = {}, -- COMMENTATOR_TEAM_2, unavailable to players
[
12
]
=
{
255
/
255
,
255
/
255
,
139
/
255
},
-- SELF, buggy
[
13
]
=
{
0
/
255
,
153
/
255
,
0
/
255
},
-- BATTLEGROUND_FRIENDLY_PVP
},
class
=
{},
debuff
=
{},
reaction
=
{},
...
...
@@ -104,7 +120,7 @@ local function colorsAndPercent(a, b, ...)
if
(
a
<=
0
or
b
==
0
)
then
return
nil
,
...
elseif
(
a
>=
b
)
then
return
nil
,
select
(
select
(
'#'
,
...
)
-
2
,
...
)
return
nil
,
select
(
-
3
,
...
)
end
local
num
=
select
(
'#'
,
...
)
/
3
...
...
@@ -125,7 +141,7 @@ last 3 RGB values are returned.
* b - value used as denominator to calculate the percentage (number)
* ... - a list of RGB percent values. At least 6 values should be passed (number [0-1])
--]]
local
function
RGBColorGradient
(
...
)
function
oUF
:
RGBColorGradient
(
...
)
local
relperc
,
r1
,
g1
,
b1
,
r2
,
g2
,
b2
=
colorsAndPercent
(
...
)
if
(
relperc
)
then
return
r1
+
(
r2
-
r1
)
*
relperc
,
g1
+
(
g2
-
g1
)
*
relperc
,
b1
+
(
b2
-
b1
)
*
relperc
...
...
@@ -139,16 +155,8 @@ local function getY(r, g, b)
return
0
.
299
*
r
+
0
.
587
*
g
+
0
.
114
*
b
end
--[[ Colors: oUF:RGBToHCY(r, g, b)
Used to convert a color from RGB to HCY color space.
* self - the global oUF object
* r - red color component (number [0-1])
* g - green color component (number [0-1])
* b - blue color component (number [0-1])
--]]
function
oUF
:
RGBToHCY
(
r
,
g
,
b
)
local
min
,
max
=
min
(
r
,
g
,
b
),
max
(
r
,
g
,
b
)
local
function
rgbToHCY
(
r
,
g
,
b
)
local
min
,
max
=
math.min
(
r
,
g
,
b
),
math.max
(
r
,
g
,
b
)
local
chroma
=
max
-
min
local
hue
if
(
chroma
>
0
)
then
...
...
@@ -164,20 +172,11 @@ function oUF:RGBToHCY(r, g, b)
return
hue
,
chroma
,
getY
(
r
,
g
,
b
)
end
local
math_abs
=
math.abs
--[[ Colors: oUF:HCYtoRGB(hue, chroma, luma)
Used to convert a color from HCY to RGB color space.
* self - the global oUF object
* hue - hue color component (number [0-1])
* chroma - chroma color component (number [0-1])
* luma - luminance color component (number [0-1])
--]]
function
oUF
:
HCYtoRGB
(
hue
,
chroma
,
luma
)
local
function
hcyToRGB
(
hue
,
chroma
,
luma
)
local
r
,
g
,
b
=
0
,
0
,
0
if
(
hue
and
luma
>
0
)
then
local
h2
=
hue
*
6
local
x
=
chroma
*
(
1
-
math
_
abs
(
h2
%
2
-
1
))
local
x
=
chroma
*
(
1
-
math
.
abs
(
h2
%
2
-
1
))
if
(
h2
<
1
)
then
r
,
g
,
b
=
chroma
,
x
,
0
elseif
(
h2
<
2
)
then
...
...
@@ -218,14 +217,14 @@ last 3 HCY values are returned.
* b - value used as denominator to calculate the percentage (number)
* ... - a list of HCY color values. At least 6 values should be passed (number [0-1])
--]]
local
function
HCYColorGradient
(
...
)
function
oUF
:
HCYColorGradient
(
...
)
local
relperc
,
r1
,
g1
,
b1
,
r2
,
g2
,
b2
=
colorsAndPercent
(
...
)
if
(
not
relperc
)
then
return
r1
,
g1
,
b1
end
local
h1
,
c1
,
y1
=
self
:
RGB
ToHCY
(
r1
,
g1
,
b1
)
local
h2
,
c2
,
y2
=
self
:
RGB
ToHCY
(
r2
,
g2
,
b2
)
local
h1
,
c1
,
y1
=
rgb
ToHCY
(
r1
,
g1
,
b1
)
local
h2
,
c2
,
y2
=
rgb
ToHCY
(
r2
,
g2
,
b2
)
local
c
=
c1
+
(
c2
-
c1
)
*
relperc
local
y
=
y1
+
(
y2
-
y1
)
*
relperc
...
...
@@ -237,9 +236,9 @@ local function HCYColorGradient(...)
dh
=
dh
-
1
end
return
self
:
HCYt
oRGB
((
h1
+
dh
*
relperc
)
%
1
,
c
,
y
)
return
hcyT
oRGB
((
h1
+
dh
*
relperc
)
%
1
,
c
,
y
)
else
return
self
:
HCYt
oRGB
(
h1
or
h2
,
c
,
y
)
return
hcyT
oRGB
(
h1
or
h2
,
c
,
y
)
end
end
...
...
@@ -253,17 +252,12 @@ set to true, `:HCYColorGradient` will be called, else `:RGBColorGradient`.
* b - value used as denominator to calculate the percentage (number)
* ... - a list of color values. At least 6 values should be passed (number [0-1])
--]]
local
function
ColorGradient
(
...
)
return
(
oUF
.
useHCYColorGradient
and
HCYColorGradient
or
RGBColorGradient
)(
...
)
function
oUF
:
ColorGradient
(
...
)
return
(
oUF
.
useHCYColorGradient
and
oUF
.
HCYColorGradient
or
oUF
.
RGBColorGradient
)(
self
,
...
)
end
Private
.
colors
=
colors
oUF
.
colors
=
colors
oUF
.
ColorGradient
=
ColorGradient
oUF
.
RGBColorGradient
=
RGBColorGradient
oUF
.
HCYColorGradient
=
HCYColorGradient
oUF
.
useHCYColorGradient
=
false
frame_metatable
.
__index
.
colors
=
colors
frame_metatable
.
__index
.
ColorGradient
=
ColorGradient
frame_metatable
.
__index
.
ColorGradient
=
oUF
.
ColorGradient
Tukui/Libs/oUF/elements/additionalpower.lua
View file @
5b648395
...
...
@@ -68,7 +68,7 @@ local function UpdateColor(element, cur, max)
if
(
element
.
colorClass
)
then
t
=
parent
.
colors
.
class
[
playerClass
]
elseif
(
element
.
colorSmooth
)
then
r
,
g
,
b
=
parent
.
ColorGradient
(
cur
,
max
,
unpack
(
element
.
smoothGradient
or
parent
.
colors
.
smooth
))
r
,
g
,
b
=
parent
:
ColorGradient
(
cur
,
max
,
unpack
(
element
.
smoothGradient
or
parent
.
colors
.
smooth
))
elseif
(
element
.
colorPower
)
then
t
=
parent
.
colors
.
power
[
ADDITIONAL_POWER_BAR_NAME
]
end
...
...
Tukui/Libs/oUF/elements/alternativepower.lua
View file @
5b648395
...
...
@@ -175,8 +175,6 @@ local function Enable(self, unit)
PlayerPowerBarAlt
:
UnregisterEvent
(
'PLAYER_ENTERING_WORLD'
)
end
element
:
Hide
()
return
true
end
end
...
...
Tukui/Libs/oUF/elements/assistantindicator.lua
View file @
5b648395
...
...
@@ -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
()
...
...
Tukui/Libs/oUF/elements/castbar.lua
View file @
5b648395
...
...
@@ -578,8 +578,6 @@ local function Enable(self, unit)
safeZone
:
SetColorTexture
(
1
,
0
,
0
)
end
element
:
Hide
()
return
true
end
end
...
...
Tukui/Libs/oUF/elements/classpower.lua
View file @
5b648395
...
...
@@ -61,9 +61,6 @@ local SPELL_POWER_HOLY_POWER = Enum.PowerType.HolyPower or 9
local
SPELL_POWER_CHI
=
Enum
.
PowerType
.
Chi
or
12
local
SPELL_POWER_ARCANE_CHARGES
=
Enum
.
PowerType
.
ArcaneCharges
or
16
-- sourced from FrameXML/TargetFrame.lua
local
MAX_COMBO_POINTS
=
MAX_COMBO_POINTS
or
5
-- Holds the class specific stuff.
local
ClassPowerID
,
ClassPowerType
local
ClassPowerEnable
,
ClassPowerDisable
...
...
@@ -103,16 +100,10 @@ local function Update(self, event, unit, powerType)
local
cur
,
max
,
mod
,
oldMax
if
(
event
~=
'ClassPowerDisable'
)
then
if
(
unit
==
'vehicle'
)
then
-- BUG: UnitPower always returns 0 combo points for vehicles
cur
=
GetComboPoints
(
unit
)
max
=
MAX_COMBO_POINTS
mod
=
1
else
cur
=
UnitPower
(
'player'
,
ClassPowerID
,
true
)
max
=
UnitPowerMax
(
'player'
,
ClassPowerID
)
mod
=
UnitPowerDisplayMod
(
ClassPowerID
)
end
local
powerID
=
unit
==
'vehicle'
and
SPELL_POWER_COMBO_POINTS
or
ClassPowerID
cur
=
UnitPower
(
unit
,
powerID
,
true
)
max
=
UnitPowerMax
(
unit
,
powerID
)
mod
=
UnitPowerDisplayMod
(
powerID
)
-- mod should never be 0, but according to Blizz code it can actually happen
cur
=
mod
==
0
and
0
or
cur
/
mod
...
...
@@ -176,7 +167,7 @@ local function Visibility(self, event, unit)
local
shouldEnable
if
(
UnitHasVehicleUI
(
'player'
))
then
shouldEnable
=
true
shouldEnable
=
PlayerVehicleHasComboPoints
()
unit
=
'vehicle'
elseif
(
ClassPowerID
)
then
if
(
not
RequireSpec
or
RequireSpec
==
GetSpecialization
())
then
...
...
Tukui/Libs/oUF/elements/grouproleindicator.lua
View file @
5b648395
...
...
@@ -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
...
...
Tukui/Libs/oUF/elements/health.lua
View file @
5b648395
...
...
@@ -17,8 +17,11 @@ A default texture will be applied if the widget is a StatusBar and doesn't have
## Options
.frequentUpdates - Indicates whether to use UNIT_HEALTH_FREQUENT instead of UNIT_HEALTH to update the bar (boolean)
.smoothGradient - 9 color values to be used with the .colorSmooth option (table)
.frequentUpdates - Indicates whether to use UNIT_HEALTH_FREQUENT instead of UNIT_HEALTH to update the
bar (boolean)
.smoothGradient - 9 color values to be used with the .colorSmooth option (table)
.considerSelectionInCombatHostile - Indicates whether selection should be considered hostile while the unit is in
combat with the player (boolean)
The following options are listed by priority. The first check that returns true decides the color of the bar.
...
...
@@ -29,6 +32,9 @@ The following options are listed by priority. The first check that returns true
.colorClassNPC - Use `self.colors.class[class]` to color the bar if the unit is a NPC (boolean)
.colorClassPet - Use `self.colors.class[class]` to color the bar if the unit is player controlled, but not a player
(boolean)
.colorSelection - Use `self.colors.selection[selection]` to color the bar based on the unit's selection color.
`selection` is defined by the return value of Private.unitSelectionType, a wrapper function
for [UnitSelectionType](https://wow.gamepedia.com/API_UnitSelectionType) (boolean)
.colorReaction - Use `self.colors.reaction[reaction]` to color the bar based on the player's reaction towards the
unit. `reaction` is defined by the return value of
[UnitReaction](http://wowprogramming.com/docs/api/UnitReaction.html) (boolean)
...
...
@@ -77,6 +83,9 @@ The following options are listed by priority. The first check that returns true
local
_
,
ns
=
...
local
oUF
=
ns
.
oUF
local
Private
=
oUF
.
Private
local
unitSelectionType
=
Private
.
unitSelectionType
local
function
UpdateColor
(
element
,
unit
,
cur
,
max
)
local
parent
=
element
.
__owner
...
...
@@ -91,10 +100,12 @@ local function UpdateColor(element, unit, cur, max)
(
element
.
colorClassPet
and
UnitPlayerControlled
(
unit
)
and
not
UnitIsPlayer
(
unit
))
then
local
_
,
class
=
UnitClass
(
unit
)
t
=
parent
.
colors
.
class
[
class
]
elseif
(
element
.
colorSelection
and
unitSelectionType
(
unit
,
element
.
considerSelectionInCombatHostile
))
then
t
=
parent
.
colors
.
selection
[
unitSelectionType
(
unit
,
element
.
considerSelectionInCombatHostile
)]
elseif
(
element
.
colorReaction
and
UnitReaction
(
unit
,
'player'
))
then
t
=
parent
.
colors
.
reaction
[
UnitReaction
(
unit
,
'player'
)]
elseif
(
element
.
colorSmooth
)
then
r
,
g
,
b
=
parent
.
ColorGradient
(
cur
,
max
,
unpack
(
element
.
smoothGradient
or
parent
.
colors
.
smooth
))
r
,
g
,
b
=
parent
:
ColorGradient
(
cur
,
max
,
unpack
(
element
.
smoothGradient
or
parent
.
colors
.
smooth
))
elseif
(
element
.
colorHealth
)
then
t
=
parent
.
colors
.
health
end
...
...
@@ -178,11 +189,31 @@ local function ForceUpdate(element)
return
Path
(
element
.
__owner
,
'ForceUpdate'
,
element
.
__owner
.
unit
)
end
--[[ Health:SetFrequentUpdates(state)
Used to toggle frequent updates.
* 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
local
function
Enable
(
self
,
unit
)
local
element
=
self
.
Health
if
(
element
)
then
element
.
__owner
=
self
element
.
ForceUpdate
=
ForceUpdate
element
.
SetFrequentUpdates
=
SetFrequentUpdates
if
(
element
.
frequentUpdates
)
then
self
:
RegisterEvent
(
'UNIT_HEALTH_FREQUENT'
,
Path
)
...
...
@@ -193,6 +224,7 @@ local function Enable(self, unit)
self
:
RegisterEvent
(
'UNIT_MAXHEALTH'
,
Path
)
self
:
RegisterEvent
(
'UNIT_CONNECTION'
,
Path
)
self
:
RegisterEvent
(
'UNIT_FACTION'
,
Path
)
-- For tapping
self
:
RegisterEvent
(
'UNIT_FLAGS'
,
Path
)
-- For selection
if
(
element
:
IsObjectType
(
'StatusBar'
)
and
not
element
:
GetStatusBarTexture
())
then
element
:
SetStatusBarTexture
(
[[Interface\TargetingFrame\UI-StatusBar]]
)
...
...
@@ -218,6 +250,7 @@ local function Disable(self)
self
:
UnregisterEvent
(
'UNIT_MAXHEALTH'
,
Path
)
self
:
UnregisterEvent
(
'UNIT_CONNECTION'
,
Path
)
self
:
UnregisterEvent
(
'UNIT_FACTION'
,
Path
)
self
:
UnregisterEvent
(
'UNIT_FLAGS'
,
Path
)
end
end
...
...
Tukui/Libs/oUF/elements/leaderindicator.lua
View file @
5b648395
...
...
@@ -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
()
...
...
Tukui/Libs/oUF/elements/phaseindicator.lua
View file @
5b648395
...
...
@@ -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]]
)
...
...
Tukui/Libs/oUF/elements/portrait.lua
View file @
5b648395
...
...
@@ -107,7 +107,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
...
...
Tukui/Libs/oUF/elements/power.lua
View file @
5b648395
...
...
@@ -17,14 +17,17 @@ A default texture will be applied if the widget is a StatusBar and doesn't have
## Options
.frequentUpdates - Indicates whether to use UNIT_POWER_FREQUENT instead UNIT_POWER_UPDATE to update the bar. Only valid
for the player and pet units (boolean)
.displayAltPower - Use this to let the widget display alternate power if the unit has one. If no alternate power the
display will fall back to primary power (boolean)
.useAtlas - Use this to let the widget use an atlas for its texture if `.atlas` is defined on the widget or an
atlas is present in `self.colors.power` for the appropriate power type (boolean)
.atlas - A custom atlas (string)
.smoothGradient - 9 color values to be used with the .colorSmooth option (table)
.frequentUpdates - Indicates whether to use UNIT_POWER_FREQUENT instead UNIT_POWER_UPDATE to update the
bar. Only valid for the player and pet units (boolean)
.displayAltPower - Use this to let the widget display alternate power if the unit has one. If no
alternate power the display will fall back to primary power (boolean)
.useAtlas - Use this to let the widget use an atlas for its texture if `.atlas` is defined on
the widget or an atlas is present in `self.colors.power` for the appropriate power
type (boolean)
.atlas - A custom atlas (string)
.smoothGradient - 9 color values to be used with the .colorSmooth option (table)
.considerSelectionInCombatHostile - Indicates whether selection should be considered hostile while the unit is in
combat with the player (boolean)
The following options are listed by priority. The first check that returns true decides the color of the bar.
...
...
@@ -42,6 +45,9 @@ The following options are listed by priority. The first check that returns true
.colorClassNPC - Use `self.colors.class[class]` to color the bar if the unit is a NPC (boolean)
.colorClassPet - Use `self.colors.class[class]` to color the bar if the unit is player controlled, but not a player
(boolean)
.colorSelection - Use `self.colors.selection[selection]` to color the bar based on the unit's selection color.
`selection` is defined by the return value of Private.unitSelectionType, a wrapper function
for [UnitSelectionType](https://wow.gamepedia.com/API_UnitSelectionType) (boolean)
.colorReaction - Use `self.colors.reaction[reaction]` to color the bar based on the player's reaction towards the
unit. `reaction` is defined by the return value of
[UnitReaction](http://wowprogramming.com/docs/api/UnitReaction.html) (boolean)
...
...
@@ -90,6 +96,9 @@ The following options are listed by priority. The first check that returns true
local
_
,
ns
=
...
local
oUF
=
ns
.
oUF
local
Private
=
oUF
.
Private
local
unitSelectionType
=
Private
.
unitSelectionType
-- sourced from FrameXML/UnitPowerBarAlt.lua
local
ALTERNATE_POWER_INDEX
=
Enum
.
PowerType
.
Alternate
or
10
...
...
@@ -133,11 +142,13 @@ local function UpdateColor(element, unit, cur, min, max, displayType)
(
element
.
colorClassPet
and
UnitPlayerControlled
(
unit
)
and
not
UnitIsPlayer
(
unit
))
then
local
_
,
class
=
UnitClass
(
unit
)
t
=
parent
.
colors
.
class
[
class
]
elseif
(
element
.
colorSelection
and
unitSelectionType
(
unit
,
element
.
considerSelectionInCombatHostile
))
then
t
=
parent
.
colors
.
selection
[
unitSelectionType
(
unit
,
element
.
considerSelectionInCombatHostile
)]
elseif
(
element
.
colorReaction
and
UnitReaction
(
unit
,
'player'
))
then
t
=
parent
.
colors
.
reaction
[
UnitReaction
(
unit
,
'player'
)]
elseif
(
element
.
colorSmooth
)
then
local
adjust
=
0
-
(
min
or
0
)
r
,
g
,
b
=
parent
.
ColorGradient
(
cur
+
adjust
,
max
+
adjust
,
unpack
(
element
.
smoothGradient
or
parent
.
colors
.
smooth
))
r
,
g
,
b
=
parent
:
ColorGradient
(
cur
+
adjust
,
max
+
adjust
,
unpack
(
element
.
smoothGradient
or
parent
.
colors
.
smooth
))
end
if
(
t
)
then
...
...
@@ -249,11 +260,31 @@ local function ForceUpdate(element)
return
Path
(
element
.
__owner
,
'ForceUpdate'
,
element
.
__owner
.
unit
)
end
--[[ Power:SetFrequentUpdates(state)
Used to toggle frequent updates.
* 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
local
function
Enable
(
self
)
local
element
=
self
.
Power
if
(
element
)
then
element
.
__owner
=
self
element
.
ForceUpdate
=
ForceUpdate
element
.
SetFrequentUpdates
=
SetFrequentUpdates
if
(
element
.
frequentUpdates
)
then
self
:
RegisterEvent
(
'UNIT_POWER_FREQUENT'
,
Path
)
...
...
@@ -267,6 +298,7 @@ local function Enable(self)
self
:
RegisterEvent
(
'UNIT_CONNECTION'
,
Path
)
self
:
RegisterEvent
(
'UNIT_MAXPOWER'
,
Path
)
self
:
RegisterEvent
(
'UNIT_FACTION'
,
Path
)
-- For tapping
self
:
RegisterEvent
(
'UNIT_FLAGS'
,
Path
)
-- For selection
if
(
element
:
IsObjectType
(
'StatusBar'
))
then
element
.
texture
=
element
:
GetStatusBarTexture
()
and
element
:
GetStatusBarTexture
():
GetTexture
()
or
[[Interface\TargetingFrame\UI-StatusBar]]
...
...
@@ -296,6 +328,7 @@ local function Disable(self)
self
:
UnregisterEvent
(
'UNIT_CONNECTION'
,
Path
)
self
:
UnregisterEvent
(
'UNIT_MAXPOWER'
,
Path
)
self
:
UnregisterEvent
(
'UNIT_FACTION'
,
Path
)
self
:
UnregisterEvent
(
'UNIT_FLAGS'
,
Path
)
end
end
...
...
Tukui/Libs/oUF/elements/powerprediction.lua
View file @
5b648395
...
...
@@ -69,10 +69,9 @@ local function Update(self, event, unit)
local
hasAltManaBar
=
ALT_MANA_BAR_PAIR_DISPLAY_INFO
[
playerClass
]
and
ALT_MANA_BAR_PAIR_DISPLAY_INFO
[
playerClass
][
mainPowerType
]
local
mainCost
,
altCost
=
0
,
0
if
(
event
==
'UNIT_SPELLCAST_START'
or
startTime
~=
endTime
)
then
if
(
event
==
'UNIT_SPELLCAST_START'
and
startTime
~=
endTime
)
then
local
costTable
=
GetSpellPowerCost
(
spellID
)
for
_
,
costInfo
in
pairs
(
costTable
)
do
for
_
,
costInfo
in
next
,
costTable
do
-- costInfo content:
-- - name: string (powerToken)
-- - type: number (powerType)
...
...
Tukui/Libs/oUF/elements/pvpclassificationindicator.lua
0 → 100644
View file @
5b648395
--[[
# Element: PvPClassificationIndicator
Handles the visibility and updating of an indicator based on the unit's PvP classification.
## Widget
PvPClassificationIndicator - A `Texture` used to display PvP classification.
## Notes
This element updates by changing the texture.
## Options
.useAtlasSize - Makes the element use preprogrammed atlas' size instead of its set dimensions (boolean)
## Examples
-- Position and size
local PvPClassificationIndicator = self:CreateTexture(nil, 'OVERLAY')
PvPClassificationIndicator:SetSize(24, 24)
PvPClassificationIndicator:SetPoint('CENTER')
-- Register it with oUF