File etc/luacheckrc.lua changed (mode: 100644) (index 420f278..6deff2f) |
1 |
1 |
--[[ http://luacheck.readthedocs.io/en/stable/config.html ]]-- |
--[[ http://luacheck.readthedocs.io/en/stable/config.html ]]-- |
2 |
|
stds.wow = { |
|
|
2 |
|
|
|
3 |
|
--[[ Functions defined in World of Warcraft client Lua environment. It is |
|
4 |
|
distinct from default Lua 5.1 environment. For example, `os` package is |
|
5 |
|
excluded. Only globals used by this project are included, therefore the list is |
|
6 |
|
only a subset and not extensive. ]]-- |
|
7 |
|
|
|
8 |
|
stds.wowapi = { |
3 |
9 |
read_globals = { |
read_globals = { |
4 |
10 |
'CreateFrame', |
'CreateFrame', |
5 |
|
'DebuffTypeColor', |
|
|
11 |
|
'GetModifiedClick', |
6 |
12 |
'GetPlayerInfoByGUID', |
'GetPlayerInfoByGUID', |
7 |
13 |
'GetRaidTargetIndex', |
'GetRaidTargetIndex', |
8 |
14 |
'GetSpellInfo', |
'GetSpellInfo', |
|
... |
... |
stds.wow = { |
10 |
16 |
'GetThreatStatusColor', |
'GetThreatStatusColor', |
11 |
17 |
'GetTime', |
'GetTime', |
12 |
18 |
'IsSpellInRange', |
'IsSpellInRange', |
13 |
|
'PowerBarColor', |
|
14 |
|
'RAID_CLASS_COLORS', |
|
15 |
|
'SetRaidTargetIconTexture', |
|
16 |
|
'UIParent', |
|
17 |
19 |
'UnitAura', |
'UnitAura', |
18 |
20 |
'UnitClass', |
'UnitClass', |
19 |
21 |
'UnitExists', |
'UnitExists', |
|
... |
... |
stds.wow = { |
33 |
35 |
'UnitPowerMax', |
'UnitPowerMax', |
34 |
36 |
'UnitPowerType', |
'UnitPowerType', |
35 |
37 |
'UnitThreatSituation', |
'UnitThreatSituation', |
|
38 |
|
'assert', |
36 |
39 |
'date', |
'date', |
|
40 |
|
'error', |
|
41 |
|
'format', |
|
42 |
|
'math', |
|
43 |
|
'pairs', |
|
44 |
|
'select', |
|
45 |
|
'string', |
37 |
46 |
'strtrim', |
'strtrim', |
38 |
47 |
'tContains', |
'tContains', |
|
48 |
|
'table', |
39 |
49 |
'time', |
'time', |
|
50 |
|
'type', |
40 |
51 |
'unpack', |
'unpack', |
41 |
52 |
}, |
}, |
42 |
53 |
globals = { |
globals = { |
|
54 |
|
'_G', |
43 |
55 |
}, |
}, |
44 |
56 |
} |
} |
45 |
57 |
|
|
46 |
|
stds.unifont = { |
|
47 |
|
read_globals = { |
|
48 |
|
'Unifont12Regular', |
|
49 |
|
'Unifont16Regular', |
|
50 |
|
'Unifont20Regular', |
|
51 |
|
} |
|
|
58 |
|
--[[ Functions defined in FrameXML or AddOns natively. ]]-- |
|
59 |
|
|
|
60 |
|
--[[ The distinction between FrameXML and Lua environment is made, so that |
|
61 |
|
testing mockups may be created more easily. The Lua environmenet is uniform |
|
62 |
|
between game versions, and even game versions can be made compatible among each |
|
63 |
|
other. On the other hand, FrameXML may be extensively modified by individual |
|
64 |
|
users, making each installation unique and reliance on FrameXML undesireable. |
|
65 |
|
Author still chose to use FrameXML for convenience. ]]-- |
|
66 |
|
|
|
67 |
|
stds.framexml = { |
|
68 |
|
read_globals = { |
|
69 |
|
'DebuffTypeColor', |
|
70 |
|
'FocusFrame', |
|
71 |
|
'GameFontWhite', |
|
72 |
|
'NumberFontNormalSmall', |
|
73 |
|
'PartyMemberFrame1', |
|
74 |
|
'PartyMemberFrame2', |
|
75 |
|
'PartyMemberFrame3', |
|
76 |
|
'PartyMemberFrame4', |
|
77 |
|
'PlayerFrame', |
|
78 |
|
'PowerBarColor', |
|
79 |
|
'RAID_CLASS_COLORS', |
|
80 |
|
'SetRaidTargetIconTexture', |
|
81 |
|
'TargetFrame', |
|
82 |
|
'ToggleDropDownMenu', |
|
83 |
|
'UIParent', |
|
84 |
|
'PlayerFrameDropDown', |
|
85 |
|
'TargetFrameDropDown', |
|
86 |
|
'FocusFrameDropDown', |
|
87 |
|
'PartyMemberBackground', |
|
88 |
|
}, |
|
89 |
|
globals = { |
|
90 |
|
}, |
52 |
91 |
} |
} |
53 |
92 |
|
|
|
93 |
|
--[[ Functions and globals defined by authors of this add-on. This list is not extensive. ]]-- |
|
94 |
|
|
54 |
95 |
stds.chorus = { |
stds.chorus = { |
55 |
96 |
read_globals = { |
read_globals = { |
56 |
97 |
}, |
}, |
57 |
98 |
globals = { |
globals = { |
58 |
99 |
'Chorus', |
'Chorus', |
|
100 |
|
'ChorusFocusButton', |
|
101 |
|
'ChorusFocusButtonHealthFrame', |
|
102 |
|
'ChorusFocusButtonUnitNameFrame', |
|
103 |
|
'ChorusPlayerButton', |
|
104 |
|
'ChorusPlayerButtonHealthFrame', |
|
105 |
|
'ChorusPlayerButtonUnitNameFrame', |
|
106 |
|
'ChorusRaidFrame', |
|
107 |
|
'ChorusTargetButton', |
|
108 |
|
'ChorusTargetButtonHealthFrame', |
|
109 |
|
'ChorusTargetButtonUnitNameFrame', |
59 |
110 |
}, |
}, |
60 |
111 |
} |
} |
61 |
112 |
|
|
62 |
|
std = 'min+wow+unifont+chorus' |
|
|
113 |
|
std = 'wowapi+framexml+chorus' |
File src/ChorusFrame.lua added (mode: 100644) (index 0000000..70c6e02) |
|
1 |
|
local UIParent = UIParent |
|
2 |
|
|
|
3 |
|
local Chorus = Chorus |
|
4 |
|
|
|
5 |
|
local function disableNativeFrames() |
|
6 |
|
local t = { |
|
7 |
|
FocusFrame, |
|
8 |
|
PlayerFrame, |
|
9 |
|
TargetFrame, |
|
10 |
|
PartyMemberFrame1, |
|
11 |
|
PartyMemberFrame2, |
|
12 |
|
PartyMemberFrame3, |
|
13 |
|
PartyMemberFrame4, |
|
14 |
|
PartyMemberBackground, |
|
15 |
|
} |
|
16 |
|
local i = 0 |
|
17 |
|
while (i < #t) do |
|
18 |
|
i = i + 1 |
|
19 |
|
local e = t[i] |
|
20 |
|
if e then |
|
21 |
|
e:Hide() |
|
22 |
|
e:SetScript('OnShow', function(self) |
|
23 |
|
self:Hide() |
|
24 |
|
end) |
|
25 |
|
end |
|
26 |
|
end |
|
27 |
|
end |
|
28 |
|
|
|
29 |
|
local function applyLayout(self) |
|
30 |
|
assert(self ~= nil) |
|
31 |
|
assert(UIParent ~= nil) |
|
32 |
|
|
|
33 |
|
self:UnregisterAllEvents(); |
|
34 |
|
self:SetScript('OnEvent', nil) |
|
35 |
|
|
|
36 |
|
--[[ FIXME Range indicator shows false information. ]]-- |
|
37 |
|
|
|
38 |
|
ChorusPlayerButtonHealthFrame.strategy = 'UnitClass' |
|
39 |
|
ChorusPlayerButton.menu = function() |
|
40 |
|
local offsetX = ChorusPlayerButton:GetWidth() / 2 |
|
41 |
|
local offsetY = ChorusPlayerButton:GetHeight() |
|
42 |
|
ToggleDropDownMenu(1, nil, PlayerFrameDropDown, 'ChorusPlayerButton', offsetX, offsetY) |
|
43 |
|
end |
|
44 |
|
|
|
45 |
|
local focuscastModifier = GetModifiedClick('FOCUSCAST') |
|
46 |
|
if focuscastModifier and 'NONE' ~= focuscastModifier then |
|
47 |
|
local key = string.lower(focuscastModifier) .. '-type1' |
|
48 |
|
ChorusPlayerButton:SetAttribute(key, 'focus') |
|
49 |
|
ChorusTargetButton:SetAttribute(key, 'focus') |
|
50 |
|
end |
|
51 |
|
|
|
52 |
|
ChorusFocusButtonHealthFrame.strategy = 'UnitIsFriend' |
|
53 |
|
ChorusFocusButtonUnitNameFrame.strategy = 'UnitClass' |
|
54 |
|
|
|
55 |
|
ChorusTargetButtonHealthFrame.strategy = 'UnitIsFriend' |
|
56 |
|
ChorusTargetButtonUnitNameFrame.strategy = 'UnitClass' |
|
57 |
|
|
|
58 |
|
--[[ FIXME Selecting "Set focus" option in the context menu for Chorus |
|
59 |
|
unit button results in permission violation exception (restricted |
|
60 |
|
execution environment issue). ]]-- |
|
61 |
|
|
|
62 |
|
ChorusTargetButton.menu = function() |
|
63 |
|
local offsetX = ChorusTargetButton:GetWidth() / 2 |
|
64 |
|
local offsetY = ChorusTargetButton:GetHeight() |
|
65 |
|
ToggleDropDownMenu(1, nil, TargetFrameDropDown, 'ChorusTargetButton', offsetX, offsetY) |
|
66 |
|
end |
|
67 |
|
|
|
68 |
|
ChorusFocusButton.menu = function() |
|
69 |
|
local offsetX = ChorusFocusButton:GetWidth() / 2 |
|
70 |
|
local offsetY = ChorusFocusButton:GetHeight() |
|
71 |
|
ToggleDropDownMenu(1, nil, FocusFrameDropDown, 'ChorusFocusButton', offsetX, offsetY) |
|
72 |
|
end |
|
73 |
|
|
|
74 |
|
--[[ NOTE The menu functions are equivalent of PlayerFrame.menu and |
|
75 |
|
TargetFrame.menu. It is possible to use them direcctly. THe only |
|
76 |
|
quirk is that the context menu will be displayed at the display point |
|
77 |
|
of the native unit frames. Hence, the need to define separate menu |
|
78 |
|
functions. ]]-- |
|
79 |
|
end |
|
80 |
|
|
|
81 |
|
local function chorusFrameMain(self) |
|
82 |
|
--[[ Wait for the game to finish loading completely, only then apply |
|
83 |
|
changes. ]]-- |
|
84 |
|
|
|
85 |
|
--[[ TODO Add pet buttons. ]]-- |
|
86 |
|
|
|
87 |
|
self:RegisterEvent('PLAYER_LOGIN'); self:SetScript('OnEvent', |
|
88 |
|
applyLayout) disableNativeFrames() end |
|
89 |
|
|
|
90 |
|
Chorus.chorusFrameMain = function(...) |
|
91 |
|
return chorusFrameMain(...) |
|
92 |
|
end |
File src/ChorusFrame.xml added (mode: 100644) (index 0000000..091aff0) |
|
1 |
|
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
<Ui xmlns="http://www.blizzard.com/wow/ui/"> |
|
3 |
|
<Script file="ChorusFrame.lua"/> |
|
4 |
|
<Frame name="ChorusFrame"> |
|
5 |
|
<Size> |
|
6 |
|
<AbsDimension x="630" y="126"/> |
|
7 |
|
</Size> |
|
8 |
|
<Anchors> |
|
9 |
|
<Anchor point="TOP"> |
|
10 |
|
<Offset x="0" y="0"/> |
|
11 |
|
</Anchor> |
|
12 |
|
<Anchor point="CENTER"> |
|
13 |
|
<Offset x="0" y="0"/> |
|
14 |
|
</Anchor> |
|
15 |
|
</Anchors> |
|
16 |
|
<Frames> |
|
17 |
|
<Button name="ChorusPlayerButton" inherits="ChorusRaidUnitButtonTemplate"> |
|
18 |
|
<Anchors> |
|
19 |
|
<Anchor point="BOTTOMLEFT"> |
|
20 |
|
<Offset x="0" y="0"/> |
|
21 |
|
</Anchor> |
|
22 |
|
</Anchors> |
|
23 |
|
<Attributes> |
|
24 |
|
<Attribute name="unit" type="string" value="player"/> |
|
25 |
|
<Attribute name="type2" type="string" value="menu"/> |
|
26 |
|
</Attributes> |
|
27 |
|
</Button> |
|
28 |
|
<Button name="ChorusTargetButton" inherits="ChorusRaidUnitButtonTemplate"> |
|
29 |
|
<Anchors> |
|
30 |
|
<Anchor point="BOTTOMLEFT" relativeTo="ChorusPlayerButton" relativePoint="BOTTOMRIGHT"> |
|
31 |
|
<Offset x="6" y="0"/> |
|
32 |
|
</Anchor> |
|
33 |
|
</Anchors> |
|
34 |
|
<Attributes> |
|
35 |
|
<Attribute name="unit" type="string" value="target"/> |
|
36 |
|
<Attribute name="type2" type="string" value="menu"/> |
|
37 |
|
</Attributes> |
|
38 |
|
</Button> |
|
39 |
|
<Button name="ChorusFocusButton" inherits="ChorusRaidUnitButtonTemplate"> |
|
40 |
|
<Anchors> |
|
41 |
|
<Anchor point="BOTTOMLEFT" relativeTo="ChorusTargetButton" relativePoint="BOTTOMRIGHT"> |
|
42 |
|
<Offset x="6" y="0"/> |
|
43 |
|
</Anchor> |
|
44 |
|
</Anchors> |
|
45 |
|
<Attributes> |
|
46 |
|
<Attribute name="unit" type="string" value="focus"/> |
|
47 |
|
<Attribute name="type2" type="string" value="menu"/> |
|
48 |
|
</Attributes> |
|
49 |
|
</Button> |
|
50 |
|
</Frames> |
|
51 |
|
<Scripts> |
|
52 |
|
<OnLoad>Chorus.chorusFrameMain(self);</OnLoad> |
|
53 |
|
</Scripts> |
|
54 |
|
</Frame> |
|
55 |
|
</Ui> |
File src/ChorusRaidFrame.xml changed (mode: 100644) (index f6303bd..52b9acc) |
39 |
39 |
<Attribute name="groupFilter" type="number" value="1"/> |
<Attribute name="groupFilter" type="number" value="1"/> |
40 |
40 |
<!-- Given raid show first raid group, given party show party. --> |
<!-- Given raid show first raid group, given party show party. --> |
41 |
41 |
<!-- Do not show party in raid. --> |
<!-- Do not show party in raid. --> |
42 |
|
<!-- Show player in party. --> |
|
|
42 |
|
<!-- Do not show player in party. --> |
43 |
43 |
<Attribute name="showParty" type="boolean" value="true"/> |
<Attribute name="showParty" type="boolean" value="true"/> |
44 |
|
<Attribute name="showPlayer" type="boolean" value="true"/> |
|
|
44 |
|
<Attribute name="showPlayer" type="boolean" value="false"/> |
45 |
45 |
<Attribute name="showSolo" type="boolean" value="false"/> |
<Attribute name="showSolo" type="boolean" value="false"/> |
46 |
46 |
</Attributes> |
</Attributes> |
47 |
47 |
</Frame> |
</Frame> |