Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tukz
Tukui
Commits
32c3df76
Commit
32c3df76
authored
Jul 23, 2020
by
Tukz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix action bar range indicator.
parent
3ad43371
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
49 deletions
+35
-49
Tukui/Modules/ActionBars/Core.lua
Tukui/Modules/ActionBars/Core.lua
+35
-0
Tukui/Modules/ActionBars/Range.lua
Tukui/Modules/ActionBars/Range.lua
+0
-48
Tukui/Modules/Init.xml
Tukui/Modules/Init.xml
+0
-1
No files found.
Tukui/Modules/ActionBars/Core.lua
View file @
32c3df76
...
...
@@ -293,12 +293,47 @@ function TukuiActionBars:UpdateActionBarsScale()
RightBar
:
SetScale
(
1
)
end
function
TukuiActionBars
:
RangeUpdate
(
hasrange
,
inrange
)
local
Icon
=
self
.
icon
local
NormalTexture
=
self
.
NormalTexture
local
ID
=
self
.
action
if
not
ID
then
return
end
local
IsUsable
,
NotEnoughMana
=
IsUsableAction
(
ID
)
local
HasRange
=
hasrange
local
InRange
=
inrange
if
IsUsable
then
if
(
HasRange
and
InRange
==
false
)
then
Icon
:
SetVertexColor
(
0
.
8
,
0
.
1
,
0
.
1
)
NormalTexture
:
SetVertexColor
(
0
.
8
,
0
.
1
,
0
.
1
)
else
Icon
:
SetVertexColor
(
1
.
0
,
1
.
0
,
1
.
0
)
NormalTexture
:
SetVertexColor
(
1
.
0
,
1
.
0
,
1
.
0
)
end
elseif
NotEnoughMana
then
Icon
:
SetVertexColor
(
0
.
1
,
0
.
3
,
1
.
0
)
NormalTexture
:
SetVertexColor
(
0
.
1
,
0
.
3
,
1
.
0
)
else
Icon
:
SetVertexColor
(
0
.
3
,
0
.
3
,
0
.
3
)
NormalTexture
:
SetVertexColor
(
0
.
3
,
0
.
3
,
0
.
3
)
end
end
function
TukuiActionBars
:
AddHooks
()
hooksecurefunc
(
"ActionButton_UpdateFlyout"
,
self
.
StyleFlyout
)
hooksecurefunc
(
"SpellButton_OnClick"
,
self
.
StyleFlyout
)
hooksecurefunc
(
ActionBarActionButtonMixin
,
"UpdateHotkeys"
,
self
.
UpdateHotKey
)
hooksecurefunc
(
"PetActionButton_SetHotkeys"
,
self
.
UpdateHotKey
)
hooksecurefunc
(
"MultiActionBar_Update"
,
self
.
UpdateActionBarsScale
)
hooksecurefunc
(
"ActionButton_UpdateRangeIndicator"
,
TukuiActionBars
.
RangeUpdate
)
end
function
TukuiActionBars
:
OnEvent
(
event
)
...
...
Tukui/Modules/ActionBars/Range.lua
deleted
100644 → 0
View file @
3ad43371
local
T
,
C
,
L
=
select
(
2
,
...
):
unpack
()
local
TukuiActionBars
=
T
[
"ActionBars"
]
local
IsUsableAction
=
IsUsableAction
local
IsActionInRange
=
IsActionInRange
local
ActionHasRange
=
ActionHasRange
function
TukuiActionBars
:
RangeOnUpdate
(
elapsed
)
if
(
not
self
.
rangeTimer
)
then
return
end
if
(
self
.
rangeTimer
==
TOOLTIP_UPDATE_TIME
)
then
TukuiActionBars
.
RangeUpdate
(
self
)
end
end
function
TukuiActionBars
:
RangeUpdate
()
local
Icon
=
self
.
icon
local
NormalTexture
=
self
.
NormalTexture
local
ID
=
self
.
action
if
not
ID
then
return
end
local
IsUsable
,
NotEnoughMana
=
IsUsableAction
(
ID
)
local
HasRange
=
ActionHasRange
(
ID
)
local
InRange
=
IsActionInRange
(
ID
)
if
IsUsable
then
-- Usable
if
(
HasRange
and
InRange
==
false
)
then
-- Out of range
Icon
:
SetVertexColor
(
0
.
8
,
0
.
1
,
0
.
1
)
NormalTexture
:
SetVertexColor
(
0
.
8
,
0
.
1
,
0
.
1
)
else
-- In range
Icon
:
SetVertexColor
(
1
.
0
,
1
.
0
,
1
.
0
)
NormalTexture
:
SetVertexColor
(
1
.
0
,
1
.
0
,
1
.
0
)
end
elseif
NotEnoughMana
then
-- Not enough power
Icon
:
SetVertexColor
(
0
.
1
,
0
.
3
,
1
.
0
)
NormalTexture
:
SetVertexColor
(
0
.
1
,
0
.
3
,
1
.
0
)
else
-- Not usable
Icon
:
SetVertexColor
(
0
.
3
,
0
.
3
,
0
.
3
)
NormalTexture
:
SetVertexColor
(
0
.
3
,
0
.
3
,
0
.
3
)
end
end
hooksecurefunc
(
ActionBarActionButtonMixin
,
"OnUpdate"
,
TukuiActionBars
.
RangeOnUpdate
)
hooksecurefunc
(
ActionBarActionButtonMixin
,
"Update"
,
TukuiActionBars
.
RangeUpdate
)
hooksecurefunc
(
ActionBarActionButtonMixin
,
"UpdateUsable"
,
TukuiActionBars
.
RangeUpdate
)
Tukui/Modules/Init.xml
View file @
32c3df76
...
...
@@ -14,7 +14,6 @@
<!-- Action Bars -->
<Script
file=
"ActionBars\Core.lua"
/>
<Script
file=
"ActionBars\Skin.lua"
/>
<Script
file=
"ActionBars\Range.lua"
/>
<Script
file=
"ActionBars\Bar1.lua"
/>
<Script
file=
"ActionBars\Bar2.lua"
/>
<Script
file=
"ActionBars\Bar3.lua"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment