File conf/lua-check/luacheckrc.lua changed (mode: 100644) (index 260a245..c644c8d) |
... |
... |
stds.wrath = { |
18 |
18 |
'CreateFrame', |
'CreateFrame', |
19 |
19 |
'GetAddOnMetadata', |
'GetAddOnMetadata', |
20 |
20 |
'GetBuildInfo', |
'GetBuildInfo', |
|
21 |
|
'GetComboPoints', |
21 |
22 |
'GetInstanceInfo', |
'GetInstanceInfo', |
22 |
23 |
'GetModifiedClick', |
'GetModifiedClick', |
23 |
24 |
'GetNumPartyMembers', |
'GetNumPartyMembers', |
|
... |
... |
stds.framexml = { |
122 |
123 |
'InterfaceOptionsFrame_OpenToCategory', |
'InterfaceOptionsFrame_OpenToCategory', |
123 |
124 |
'InterfaceOptions_AddCategory', |
'InterfaceOptions_AddCategory', |
124 |
125 |
'KEY_SLASH', |
'KEY_SLASH', |
|
126 |
|
'MAX_COMBO_POINTS', |
125 |
127 |
'MAX_PARTY_MEMBERS', |
'MAX_PARTY_MEMBERS', |
126 |
128 |
'MAX_RAID_MEMBERS', |
'MAX_RAID_MEMBERS', |
127 |
129 |
'MAX_RAID_MEMBERS', |
'MAX_RAID_MEMBERS', |
|
... |
... |
stds.framexml = { |
153 |
155 |
'RegisterStateDriver', |
'RegisterStateDriver', |
154 |
156 |
'RegisterUnitWatch', |
'RegisterUnitWatch', |
155 |
157 |
'RuneFrame', |
'RuneFrame', |
|
158 |
|
'SPELL_POWER_ENERGY', |
156 |
159 |
'SecureButton_GetAttribute', |
'SecureButton_GetAttribute', |
157 |
160 |
'SecureButton_GetUnit', |
'SecureButton_GetUnit', |
158 |
161 |
'SecureCmdOptionParse', |
'SecureCmdOptionParse', |
File conf/make/src.mk changed (mode: 100644) (index d46f60b..3584a89) |
... |
... |
${srcdir}src/ChorusAuraFrameTemplate.lua \ |
13 |
13 |
${srcdir}src/ChorusAuraTooltipFrameTemplate.lua \ |
${srcdir}src/ChorusAuraTooltipFrameTemplate.lua \ |
14 |
14 |
${srcdir}src/ChorusAuraTooltipToggleButtonTemplate.lua \ |
${srcdir}src/ChorusAuraTooltipToggleButtonTemplate.lua \ |
15 |
15 |
${srcdir}src/ChorusCastFrameTemplate.lua \ |
${srcdir}src/ChorusCastFrameTemplate.lua \ |
|
16 |
|
${srcdir}src/ChorusComboPointsStatusBarTemplate.lua \ |
16 |
17 |
${srcdir}src/ChorusConfFrame.lua \ |
${srcdir}src/ChorusConfFrame.lua \ |
17 |
18 |
${srcdir}src/ChorusFrame.lua \ |
${srcdir}src/ChorusFrame.lua \ |
18 |
19 |
${srcdir}src/ChorusGroupFrame.lua \ |
${srcdir}src/ChorusGroupFrame.lua \ |
|
... |
... |
${srcdir}src/ChorusAuraTooltipFrameTemplate.xml \ |
46 |
47 |
${srcdir}src/ChorusAuraTooltipSingletonFrame.xml \ |
${srcdir}src/ChorusAuraTooltipSingletonFrame.xml \ |
47 |
48 |
${srcdir}src/ChorusAuraTooltipToggleButtonTemplate.xml \ |
${srcdir}src/ChorusAuraTooltipToggleButtonTemplate.xml \ |
48 |
49 |
${srcdir}src/ChorusCastFrameTemplate.xml \ |
${srcdir}src/ChorusCastFrameTemplate.xml \ |
|
50 |
|
${srcdir}src/ChorusComboPointsStatusBarTemplate.xml \ |
49 |
51 |
${srcdir}src/ChorusConfFrame.xml \ |
${srcdir}src/ChorusConfFrame.xml \ |
50 |
52 |
${srcdir}src/ChorusFocusFrame.xml \ |
${srcdir}src/ChorusFocusFrame.xml \ |
51 |
53 |
${srcdir}src/ChorusFont.xml \ |
${srcdir}src/ChorusFont.xml \ |
File src/Chorus.lua changed (mode: 100644) (index 40194fa..ab55c55) |
... |
... |
Chorus = {} |
13 |
13 |
|
|
14 |
14 |
Chorus.test = {} |
Chorus.test = {} |
15 |
15 |
|
|
|
16 |
|
--[[ Do constants ]]-- |
|
17 |
|
|
|
18 |
|
do |
|
19 |
|
--[[ FrameXML/Constants.lua ]]-- |
|
20 |
|
Chorus.SPELL_POWER_ENERGY = SPELL_POWER_ENERGY or 3 |
|
21 |
|
--[[ FrameXML/UnitFrame.lua:PowerBarColor ]]-- |
|
22 |
|
Chorus.PowerBarColor = PowerBarColor or {} |
|
23 |
|
--[[ FrameXML/TargetFrame.lua:MAX_COMBO_POINTS ]]-- |
|
24 |
|
Chorus.MAX_COMBO_POINTS = MAX_COMBO_POINTS or 5 |
|
25 |
|
end |
|
26 |
|
|
|
27 |
|
--[[ End constants ]]-- |
|
28 |
|
|
16 |
29 |
--[[-- |
--[[-- |
17 |
30 |
Utility function for developers that lists and caches, using SavedVariables |
Utility function for developers that lists and caches, using SavedVariables |
18 |
31 |
mechanism, all function names that were defined by this project. |
mechanism, all function names that were defined by this project. |
File src/Chorus.xml changed (mode: 100644) (index a88c615..bc8c178) |
14 |
14 |
<Include file="ChorusUnitPowerFrameTemplate.xml"/> |
<Include file="ChorusUnitPowerFrameTemplate.xml"/> |
15 |
15 |
<Include file="ChorusUnitPowerStatusBarTemplate.xml"/> |
<Include file="ChorusUnitPowerStatusBarTemplate.xml"/> |
16 |
16 |
<Include file="ChorusCastFrameTemplate.xml"/> |
<Include file="ChorusCastFrameTemplate.xml"/> |
|
17 |
|
<Include file="ChorusComboPointsStatusBarTemplate.xml"/> |
17 |
18 |
<Include file="ChorusUnitNameFrameTemplate.xml"/> |
<Include file="ChorusUnitNameFrameTemplate.xml"/> |
18 |
19 |
<Include file="ChorusRangeFrameTemplate.xml"/> |
<Include file="ChorusRangeFrameTemplate.xml"/> |
19 |
20 |
<Include file="ChorusReadyCheckFrameTemplate.xml"/> |
<Include file="ChorusReadyCheckFrameTemplate.xml"/> |
File src/ChorusComboPointsStatusBarTemplate.lua added (mode: 100644) (index 0000000..b5cd08c) |
|
1 |
|
--[[-- |
|
2 |
|
@submodule chorus |
|
3 |
|
]] |
|
4 |
|
|
|
5 |
|
local MAX_COMBO_POINTS = Chorus.MAX_COMBO_POINTS or 5 |
|
6 |
|
local PowerBarColor = Chorus.PowerBarColor or {} |
|
7 |
|
local SPELL_POWER_ENERGY = Chorus.SPELL_POWER_ENERGY or 3 |
|
8 |
|
|
|
9 |
|
local Chorus = Chorus |
|
10 |
|
|
|
11 |
|
local function eventProcessor(comboPointsStatusBar, eventCategory, eventUnit) |
|
12 |
|
eventCategory = tostring(eventCategory) |
|
13 |
|
assert(eventCategory ~= nil) |
|
14 |
|
eventUnit = tostring(eventUnit or 'player') |
|
15 |
|
local thisUnit = SecureButton_GetUnit(comboPointsStatusBar) |
|
16 |
|
if UnitIsUnit(thisUnit, eventUnit) then |
|
17 |
|
local o = comboPointsStatusBar:GetAttribute('chorus-target') or 'target' |
|
18 |
|
local p = GetComboPoints(thisUnit, o) |
|
19 |
|
comboPointsStatusBar:SetValue(p) |
|
20 |
|
|
|
21 |
|
local _, m = comboPointsStatusBar:GetMinMaxValues() |
|
22 |
|
local x = string.format('%d / %d', p, m) |
|
23 |
|
comboPointsStatusBar.text:SetText(x) |
|
24 |
|
|
|
25 |
|
if p < 1 then |
|
26 |
|
comboPointsStatusBar:Hide() |
|
27 |
|
else |
|
28 |
|
comboPointsStatusBar:Show() |
|
29 |
|
end |
|
30 |
|
end |
|
31 |
|
end |
|
32 |
|
|
|
33 |
|
function Chorus.comboPointsStatusBarMain(comboPointsStatusBar) |
|
34 |
|
assert(comboPointsStatusBar ~= nil) |
|
35 |
|
|
|
36 |
|
comboPointsStatusBar:SetMinMaxValues(0, MAX_COMBO_POINTS or 5) |
|
37 |
|
|
|
38 |
|
local colorTuple = PowerBarColor[SPELL_POWER_ENERGY] or {} |
|
39 |
|
comboPointsStatusBar:SetStatusBarColor(colorTuple.r or 1, colorTuple.g or 1, colorTuple.b or 1) |
|
40 |
|
|
|
41 |
|
comboPointsStatusBar:RegisterEvent('PLAYER_FOCUS_CHANGED') |
|
42 |
|
comboPointsStatusBar:RegisterEvent('PLAYER_LOGIN') |
|
43 |
|
comboPointsStatusBar:RegisterEvent('PLAYER_TARGET_CHANGED') |
|
44 |
|
|
|
45 |
|
comboPointsStatusBar:RegisterEvent('UNIT_COMBO_POINTS') |
|
46 |
|
comboPointsStatusBar:SetScript('OnEvent', eventProcessor) |
|
47 |
|
end |
File src/ChorusComboPointsStatusBarTemplate.xml added (mode: 100644) (index 0000000..4d6668c) |
|
1 |
|
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
|
3 |
|
<Script file="ChorusComboPointsStatusBarTemplate.lua"/> |
|
4 |
|
<StatusBar name="ChorusComboPointsStatusBarTemplate" minValue="0" maxValue="5" defaultValue="1" virtual="true"> |
|
5 |
|
<Size> |
|
6 |
|
<AbsDimension x="60" y="12"/> |
|
7 |
|
</Size> |
|
8 |
|
<Layers> |
|
9 |
|
<!-- TODO Add custom texture with five boxes that blends with background. --> |
|
10 |
|
<!-- |
|
11 |
|
<Layer level="ARTWORK"> |
|
12 |
|
<Texture name="$parentArtwork" setAllPoints="true" parentKey="artwork"> |
|
13 |
|
<Color r="0" g="0" b="0"/> |
|
14 |
|
</Texture> |
|
15 |
|
</Layer> |
|
16 |
|
--> |
|
17 |
|
<Layer level="OVERLAY"> |
|
18 |
|
<FontString name="$parentText" parentKey="text" inherits="ChorusFont12Mono" justifyH="CENTER" justifyV="MIDDLE" setAllPoints="true"/> |
|
19 |
|
</Layer> |
|
20 |
|
</Layers> |
|
21 |
|
<Scripts> |
|
22 |
|
<OnLoad>Chorus.comboPointsStatusBarMain(self);</OnLoad> |
|
23 |
|
</Scripts> |
|
24 |
|
<Attributes> |
|
25 |
|
<Attribute name="useparent-unit" type="boolean" value="true"/> |
|
26 |
|
<Attribute name="chorus-target" type="string" value="target"/> |
|
27 |
|
</Attributes> |
|
28 |
|
<BarTexture name="$parentBackground" file="Interface\TargetingFrame\UI-StatusBar" parentKey="background"/> |
|
29 |
|
<BarColor r="1" g="1" b="0" a="1"/> |
|
30 |
|
</StatusBar> |
|
31 |
|
</Ui> |
File src/ChorusFocusFrame.xml changed (mode: 100644) (index de3c893..0ea779c) |
20 |
20 |
<Attribute name="unit" type="string" value="focustarget"/> |
<Attribute name="unit" type="string" value="focustarget"/> |
21 |
21 |
</Attributes> |
</Attributes> |
22 |
22 |
</Frame> |
</Frame> |
|
23 |
|
<StatusBar name="ChorusFocusComboPointsStatusBar" inherits="ChorusComboPointsStatusBarTemplate"> |
|
24 |
|
<Size> |
|
25 |
|
<AbsDimension x="60" y="12"/> |
|
26 |
|
</Size> |
|
27 |
|
<Anchors> |
|
28 |
|
<Anchor point="BOTTOMRIGHT" relativeTo="ChorusFocusFrame" relativePoint="TOPRIGHT"> |
|
29 |
|
<Offset x="6" y="6"/> |
|
30 |
|
</Anchor> |
|
31 |
|
</Anchors> |
|
32 |
|
<Attributes> |
|
33 |
|
<Attribute name="unit" type="string" value="player"/> |
|
34 |
|
<Attribute name="chorus-target" type="string" value="focus"/> |
|
35 |
|
</Attributes> |
|
36 |
|
</StatusBar> |
23 |
37 |
</Ui> |
</Ui> |
File src/ChorusTargetFrame.xml changed (mode: 100644) (index 73c634a..3a338f4) |
20 |
20 |
<Attribute name="unit" type="string" value="targettarget"/> |
<Attribute name="unit" type="string" value="targettarget"/> |
21 |
21 |
</Attributes> |
</Attributes> |
22 |
22 |
</Frame> |
</Frame> |
|
23 |
|
<StatusBar name="ChorusTargetComboPointsStatusBar" inherits="ChorusComboPointsStatusBarTemplate"> |
|
24 |
|
<Size> |
|
25 |
|
<AbsDimension x="60" y="12"/> |
|
26 |
|
</Size> |
|
27 |
|
<Anchors> |
|
28 |
|
<Anchor point="BOTTOMRIGHT" relativeTo="ChorusTargetFrame" relativePoint="TOPRIGHT"> |
|
29 |
|
<Offset x="6" y="6"/> |
|
30 |
|
</Anchor> |
|
31 |
|
</Anchors> |
|
32 |
|
<Attributes> |
|
33 |
|
<Attribute name="unit" type="string" value="player"/> |
|
34 |
|
<Attribute name="chorus-target" type="string" value="target"/> |
|
35 |
|
</Attributes> |
|
36 |
|
</StatusBar> |
23 |
37 |
</Ui> |
</Ui> |