vrtc / chorus (public) (License: CC0) (since 2023-08-12) (hash sha1)
World of Warcraft add-on stub. The overall goal is to create a specialized raid frame.
List of commits:
Subject Hash Author Date (UTC)
feat!: Add cast bar for huge unit buttons f921c3e2c1417036981f9e7ac9d070d66e4d7d19 Vladyslav Bondarenko 2023-08-25 11:38:37
fix: Add threat and range widgets to large buttons 8956671551dbd110d2f62b482579851f5283a065 Vladyslav Bondarenko 2023-08-25 09:36:02
fix: Filter out irrelevant events for status bars d11036a029bb51458c5bc592baf592463a05f11a Vladyslav Bondarenko 2023-08-25 09:02:07
feat: When group member out of range fade out e1b06d6c96ddceb3aa35ad5cc249671a5c1bf852 Vladyslav Bondarenko 2023-08-25 08:58:53
fix: Add unit tooltip 9b853289a7730a8783f02691c944492e0ef53f86 Vladyslav Bondarenko 2023-08-25 08:15:33
fix: Yet another health bar sanitization 979af69272eec06c45cb300132bc020a91a180c2 Vladyslav Bondarenko 2023-08-24 03:52:05
feat(build): Add stub RocketGit hook b1a0bb523fb570ee7cc73776bfbba1a6886e685f Vladyslav Bondarenko 2023-08-23 23:59:35
feat(build): Add 0.2-1 rockspec 92a2b006a47f1a242bbb08467c431362d64d6ef8 Vladyslav Bondarenko 2023-08-23 23:31:41
fix!: Use native mechanism of inheriting values 6a2ebf1aa52e4a300b4ad959670878b292140c4f Vladyslav Bondarenko 2023-08-23 23:05:39
fix: Typo in unit button template anchor 98027a2779639493c97c4259b61cb53d25709255 Vladyslav Bondarenko 2023-08-23 22:06:16
feat!: Add unit button flavours 21e61a0dbd629d25f458ce1a8dd370da31c6f991 Vladyslav Bondarenko 2023-08-23 21:17:33
fix: Shrink range frame height b73521b13c6a9e5d34b2d425e5d7e9ddcb04f81c Vladyslav Bondarenko 2023-08-23 21:15:28
feat: Hide status bar text on demand 307d97f5afee88e55c6799e4c4390ca8d6e98974 Vladyslav Bondarenko 2023-08-23 21:11:35
feat: Hide auras out of frame bounds cb9ca55fb9dc361500e8b4f4c84320eb7d01b744 Vladyslav Bondarenko 2023-08-23 20:53:30
fix: Add text shadow to unit names 2b7d56c701ad81825a838c9faa818632bf38bfb6 Vladyslav Bondarenko 2023-08-23 17:30:23
fix: Further sanitize health bar 3318dee15eac9b8205e287997800c080b0aaf12d Vladyslav Bondarenko 2023-08-23 14:56:00
feat!: Correct range indcator for all characters 8ef1a987ac4431ce90131c354d1a1775b653f3e3 Vladyslav Bondarenko 2023-08-22 15:05:35
fix: Improve health bar robustness 2be053184653a6cd282437f8190e9196af495d81 Vladyslav Bondarenko 2023-08-22 13:24:12
fix: Upgrade aura sorting a2132995674f81e0775def67b0f5786945b0bba3 Vladyslav Bondarenko 2023-08-22 13:21:37
feat: Add threat percentage for hostiles 590bc95167dfc0f22a135fe173182104b6f5b923 Vladyslav Bondarenko 2023-08-22 13:17:57
Commit f921c3e2c1417036981f9e7ac9d070d66e4d7d19 - feat!: Add cast bar for huge unit buttons
Author: Vladyslav Bondarenko
Author date (UTC): 2023-08-25 11:38
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2023-08-25 11:38
Parent(s): 8956671551dbd110d2f62b482579851f5283a065
Signer:
Signing key: EFF9624877D25D02
Signing status: E
Tree: c79c6d0ce3d617c0819e701a81f7a92d0a7d5027
File Lines added Lines deleted
etc/luacheckrc.lua 2 0
src/Chorus.xml 1 0
src/ChorusCastFrameTemplate.lua 148 0
src/ChorusCastFrameTemplate.xml 82 0
src/ChorusFrame.xml 1 1
src/ChorusUnitButtonTemplate.xml 36 20
File etc/luacheckrc.lua changed (mode: 100644) (index 3228a4d..88120fc)
... ... stds.wowapi = {
18 18 'GetTime', 'GetTime',
19 19 'IsSpellInRange', 'IsSpellInRange',
20 20 'UnitAura', 'UnitAura',
21 'UnitCastingInfo',
22 'UnitChannelInfo',
21 23 'UnitClass', 'UnitClass',
22 24 'UnitDetailedThreatSituation', 'UnitDetailedThreatSituation',
23 25 'UnitExists', 'UnitExists',
File src/Chorus.xml changed (mode: 100644) (index 6e4a886..ec3c246)
7 7 <Include file="ChorusProgressFrameTemplate.xml"/> <Include file="ChorusProgressFrameTemplate.xml"/>
8 8 <Include file="ChorusHealthFrameTemplate.xml"/> <Include file="ChorusHealthFrameTemplate.xml"/>
9 9 <Include file="ChorusPowerFrameTemplate.xml"/> <Include file="ChorusPowerFrameTemplate.xml"/>
10 <Include file="ChorusCastFrameTemplate.xml"/>
10 11 <Include file="ChorusUnitNameFrameTemplate.xml"/> <Include file="ChorusUnitNameFrameTemplate.xml"/>
11 12 <Include file="ChorusRangeFrameTemplate.xml"/> <Include file="ChorusRangeFrameTemplate.xml"/>
12 13 <Include file="ChorusThreatFrameTemplate.xml"/> <Include file="ChorusThreatFrameTemplate.xml"/>
File src/ChorusCastFrameTemplate.lua added (mode: 100644) (index 0000000..21fcc6e)
1 local GetTime = GetTime
2 local UnitCastingInfo = UnitCastingInfo
3 local UnitChannelInfo = UnitChannelInfo
4 local UnitExists = UnitExists
5 local tContains = tContains
6
7 local SecureButton_GetUnit = SecureButton_GetUnit
8
9 local Chorus = Chorus
10
11 local function castFrameEventIsRelevant(self, eventCategory, ...)
12 assert(self ~= nil)
13 assert(eventCategory ~= nil)
14
15 local u = SecureButton_GetUnit(self)
16 local eu = select(1, ...)
17 if eu and u then
18 return UnitIsUnit(u, eu)
19 else
20 return true
21 end
22 end
23
24 local function castFrameEventProcessor(self, eventCategory, ...)
25 assert(self ~= nil)
26
27 if not castFrameEventIsRelevant(self, eventCategory, ...) then
28 return
29 end
30
31 --print(self:GetName(), eventCategory, ...)
32
33 local u = SecureButton_GetUnit(self)
34 if not u or not UnitExists(u) then
35 self:Hide()
36 return
37 end
38
39 local artwork1 = self.artwork1 or _G[self:GetName() .. 'Artwork1']
40 assert(artwork1 ~= nil)
41
42 local artwork2 = self.artwork2 or _G[self:GetName() .. 'Artwork2']
43 assert(artwork2 ~= nil)
44
45 local label1 = self.label1 or _G[self:GetName() .. 'Text1']
46 assert(label1 ~= nil)
47
48 local label2 = self.label2 or _G[self:GetName() .. 'Text2']
49 assert(label2 ~= nil)
50
51 local spellName, pictureFile, startInstance, endInstance, shieldedFlag
52 local spellName0, _, _, pictureFile0, startInstance0, endInstance0, _, _, shieldedFlag0 = UnitCastingInfo(u)
53 local spellName1, _, _, pictureFile1, startInstance1, endInstance1, _, _, shieldedFlag1 = UnitChannelInfo(u)
54 if spellName0 then
55 spellName = spellName0
56 pictureFile = pictureFile0
57 startInstance = startInstance0
58 endInstance = endInstance0
59 shieldedFlag = shieldedFlag0
60 elseif spellName1 then
61 spellName = spellName1
62 pictureFile = pictureFile1
63 startInstance = startInstance1
64 endInstance = endInstance1
65 shieldedFlag = shieldedFlag1
66 end
67
68 if tContains({'UNIT_SPELLCAST_START', 'UNIT_SPELLCAST_CHANNEL_START', 'UNIT_SPELLCAST_DELAYED'}, eventCategory) then
69 if spellName then
70 label1:SetText(spellName)
71 end
72 if pictureFile then
73 artwork1:SetTexture(pictureFile)
74 end
75 if shieldedFlag then
76 artwork2:SetVertexColor(248 / 255, 248 / 255, 1)
77 label1:SetTextColor(1, 215 / 255, 0)
78 elseif UnitIsFriend('player', u) then
79 artwork2:SetVertexColor(143 / 255, 188 / 255, 143 / 255)
80 label1:SetTextColor(248 / 255, 248 / 255, 1)
81 else
82 artwork2:SetVertexColor(1, 69 / 255, 0)
83 label1:SetTextColor(248 / 255, 248 / 255, 1)
84 end
85 self:SetMinMaxValues(startInstance, endInstance)
86 self:Show()
87 elseif tContains({'UNIT_SPELLCAST_STOP', 'UNIT_SPELLCAST_CHANNEL_STOP'}, eventCategory) then
88 self:Hide()
89 end
90 end
91
92 local function castFrameUpdateProcessor(self)
93 assert(self ~= nil)
94
95 local u = SecureButton_GetUnit(self)
96 if not u then
97 return
98 end
99
100 local now = GetTime() * 1000
101 self:SetValue(now)
102 local _, b = self:GetMinMaxValues()
103
104 local label2 = self.label2 or _G[self:GetName() .. 'Text2']
105 assert(label2 ~= nil)
106
107 local durationRemainingSec = (b - now) / 1000
108 local t = string.format('%.1f', durationRemainingSec)
109 label2:SetText(t)
110 end
111
112 local function castFrameMain(self)
113 assert(self ~= nil)
114
115 local n = self:GetName()
116 assert(n ~= nil)
117
118 self.artwork1 = _G[n .. 'Artwork1']
119 assert(self.artwork1 ~= nil)
120
121 self.artwork2 = _G[n .. 'Artwork2']
122 assert(self.artwork2 ~= nil)
123
124 self.label1 = _G[n .. 'Text1']
125 assert(self.label1 ~= nil)
126
127 self.label2 = _G[n .. 'Text2']
128 assert(self.label2 ~= nil)
129
130 self:SetScript('OnEvent', castFrameEventProcessor)
131 self:SetScript('OnUpdate', castFrameUpdateProcessor)
132
133 self:RegisterEvent("PLAYER_ENTERING_WORLD");
134 self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_START");
135 self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP");
136 self:RegisterEvent("UNIT_SPELLCAST_CHANNEL_UPDATE");
137 self:RegisterEvent("UNIT_SPELLCAST_DELAYED");
138 self:RegisterEvent("UNIT_SPELLCAST_FAILED");
139 self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTED");
140 self:RegisterEvent("UNIT_SPELLCAST_INTERRUPTIBLE");
141 self:RegisterEvent("UNIT_SPELLCAST_NOT_INTERRUPTIBLE");
142 self:RegisterEvent("UNIT_SPELLCAST_START");
143 self:RegisterEvent("UNIT_SPELLCAST_STOP");
144 end
145
146 Chorus.castFrameMain = function(...)
147 return castFrameMain(...)
148 end
File src/ChorusCastFrameTemplate.xml added (mode: 100644) (index 0000000..644da1d)
1 <?xml version="1.0" encoding="UTF-8"?>
2 <Ui xmlns="http://www.blizzard.com/wow/ui/">
3 <Script file="ChorusCastFrameTemplate.lua"/>
4 <StatusBar name="ChorusCastFrameTemplate" virtual="true" hidden="true">
5 <Layers>
6 <Layer level="BACKGROUND">
7 <Texture name="$parentBackground" nonBlocking="true" setAllPoints="true">
8 <Color r="0" g="0" b="0" a="0.4"/>
9 </Texture>
10 </Layer>
11 <Layer level="OVERLAY">
12 <Texture file="Interface\Icons\INV_Misc_QuestionMark" name="$parentArtwork1" nonBlocking="true">
13 <Size>
14 <AbsDimension x="16" y="16"/>
15 </Size>
16 <Anchors>
17 <Anchor point="TOPLEFT">
18 <Offset>
19 <AbsDimension x="0" y="0"/>
20 </Offset>
21 </Anchor>
22 </Anchors>
23 </Texture>
24 <FontString name="$parentText1" inherits="ChorusFont12Sans" justifyH="LEFT" justifyV="MIDDLE">
25 <Anchors>
26 <Anchor point="TOPRIGHT">
27 <Offset x="0" y="0"/>
28 </Anchor>
29 <Anchor point="TOPLEFT" relativeTo="$parentArtwork1" relativePoint="TOPRIGHT">
30 <Offset x="0" y="0"/>
31 </Anchor>
32 <Anchor point="BOTTOMLEFT" relativeTo="$parentArtwork1" relativePoint="BOTTOMRIGHT">
33 <Offset x="0" y="0"/>
34 </Anchor>
35 <Anchor point="BOTTOMRIGHT">
36 <Offset x="0" y="0"/>
37 </Anchor>
38 </Anchors>
39 </FontString>
40 <FontString name="$parentText2" inherits="ChorusFont12Mono" justifyH="RIGHT" justifyV="MIDDLE">
41 <Anchors>
42 <Anchor point="TOPRIGHT">
43 <Offset x="0" y="0"/>
44 </Anchor>
45 <Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPRIGHT">
46 <Offset x="-36" y="0"/>
47 </Anchor>
48 <Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="BOTTOMRIGHT">
49 <Offset x="-36" y="0"/>
50 </Anchor>
51 <Anchor point="BOTTOMRIGHT">
52 <Offset x="0" y="0"/>
53 </Anchor>
54 </Anchors>
55 </FontString>
56 </Layer>
57 </Layers>
58 <Scripts>
59 <OnLoad>Chorus.castFrameMain(self);</OnLoad>
60 </Scripts>
61 <Attributes>
62 <Attribute name="useparent-unit" type="boolean" value="true"/>
63 </Attributes>
64 <BarTexture name="$parentArtwork2" file="Interface\TargetingFrame\UI-StatusBar">
65 <Anchors>
66 <Anchor point="TOPRIGHT">
67 <Offset x="0" y="0"/>
68 </Anchor>
69 <Anchor point="TOPLEFT" relativeTo="$parentArtwork1" relativePoint="TOPRIGHT">
70 <Offset x="0" y="0"/>
71 </Anchor>
72 <Anchor point="BOTTOMLEFT" relativeTo="$parentArtwork1" relativePoint="BOTTOMRIGHT">
73 <Offset x="0" y="0"/>
74 </Anchor>
75 <Anchor point="BOTTOMRIGHT">
76 <Offset x="0" y="0"/>
77 </Anchor>
78 </Anchors>
79 </BarTexture>
80 <BarColor r="1" g="0" b="1" a="1"/>
81 </StatusBar>
82 </Ui>
File src/ChorusFrame.xml changed (mode: 100644) (index 8d0268c..adb5aa9)
3 3 <Script file="ChorusFrame.lua"/> <Script file="ChorusFrame.lua"/>
4 4 <Frame name="ChorusFrame"> <Frame name="ChorusFrame">
5 5 <Size> <Size>
6 <AbsDimension x="786" y="128"/>
6 <AbsDimension x="786" y="160"/>
7 7 </Size> </Size>
8 8 <Anchors> <Anchors>
9 9 <Anchor point="TOP"> <Anchor point="TOP">
File src/ChorusUnitButtonTemplate.xml changed (mode: 100644) (index 30896b3..ef0a844)
200 200 </Button> </Button>
201 201 <Button name="ChorusHugeUnitButtonTemplate" inherits="ChorusUnitButtonTemplate" virtual="true"> <Button name="ChorusHugeUnitButtonTemplate" inherits="ChorusUnitButtonTemplate" virtual="true">
202 202 <Size> <Size>
203 <AbsDimension x="256" y="128"/>
203 <AbsDimension x="256" y="160"/>
204 204 </Size> </Size>
205 205 <Frames> <Frames>
206 206 <Frame name="$parentUnitNameFrame" inherits="ChorusUnitNameFrameTemplate"> <Frame name="$parentUnitNameFrame" inherits="ChorusUnitNameFrameTemplate">
 
211 211 <Anchor point="TOPLEFT"> <Anchor point="TOPLEFT">
212 212 <Offset x="0" y="0"/> <Offset x="0" y="0"/>
213 213 </Anchor> </Anchor>
214 <Anchor point="BOTTOMLEFT">
215 <Offset x="0" y="100"/>
214 <Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
215 <Offset x="0" y="-16"/>
216 216 </Anchor> </Anchor>
217 <Anchor point="BOTTOMRIGHT">
218 <Offset x="0" y="100"/>
217 <Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT">
218 <Offset x="0" y="-16"/>
219 219 </Anchor> </Anchor>
220 220 </Anchors> </Anchors>
221 221 </Frame> </Frame>
222 222 <Frame name="$parentRaidTargetIconFrame" inherits="ChorusRaidTargetIconFrameTemplate"> <Frame name="$parentRaidTargetIconFrame" inherits="ChorusRaidTargetIconFrameTemplate">
223 223 <Anchors> <Anchors>
224 224 <Anchor point="TOPLEFT"> <Anchor point="TOPLEFT">
225 <Offset x="124" y="-20"/>
225 <Offset x="120" y="-24"/>
226 226 </Anchor> </Anchor>
227 227 </Anchors> </Anchors>
228 228 </Frame> </Frame>
229 229 <Frame name="$parentThreatFrame" inherits="ChorusThreatFrameTemplate"> <Frame name="$parentThreatFrame" inherits="ChorusThreatFrameTemplate">
230 230 <Anchors> <Anchors>
231 231 <Anchor point="TOPLEFT"> <Anchor point="TOPLEFT">
232 <Offset x="0" y="-20"/>
232 <Offset x="0" y="-24"/>
233 233 </Anchor> </Anchor>
234 234 </Anchors> </Anchors>
235 235 </Frame> </Frame>
236 236 <Frame name="$parentRangeFrame" inherits="ChorusRangeFrameTemplate"> <Frame name="$parentRangeFrame" inherits="ChorusRangeFrameTemplate">
237 237 <Anchors> <Anchors>
238 238 <Anchor point="TOPRIGHT"> <Anchor point="TOPRIGHT">
239 <Offset x="0" y="-20"/>
239 <Offset x="0" y="-24"/>
240 240 </Anchor> </Anchor>
241 241 </Anchors> </Anchors>
242 242 </Frame> </Frame>
 
248 248 <Anchor point="TOPLEFT"> <Anchor point="TOPLEFT">
249 249 <Offset x="0" y="0"/> <Offset x="0" y="0"/>
250 250 </Anchor> </Anchor>
251 <Anchor point="BOTTOMLEFT">
252 <Offset x="0" y="80"/>
251 <Anchor point="BOTTOMLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
252 <Offset x="0" y="-64"/>
253 253 </Anchor> </Anchor>
254 <Anchor point="BOTTOMRIGHT">
255 <Offset x="0" y="80"/>
254 <Anchor point="BOTTOMRIGHT" relativeTo="$parent" relativePoint="TOPRIGHT">
255 <Offset x="0" y="-64"/>
256 256 </Anchor> </Anchor>
257 257 </Anchors> </Anchors>
258 258 </StatusBar> </StatusBar>
259 259 <StatusBar name="$parentPowerFrame" inherits="ChorusPowerFrameTemplate"> <StatusBar name="$parentPowerFrame" inherits="ChorusPowerFrameTemplate">
260 260 <Anchors> <Anchors>
261 <Anchor point="TOPRIGHT">
262 <Offset x="0" y="-48"/>
261 <Anchor point="TOPRIGHT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMRIGHT">
262 <Offset x="0" y="0"/>
263 263 </Anchor> </Anchor>
264 <Anchor point="TOPLEFT">
265 <Offset x="0" y="-48"/>
264 <Anchor point="TOPLEFT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMLEFT">
265 <Offset x="0" y="0"/>
266 266 </Anchor> </Anchor>
267 <Anchor point="BOTTOMLEFT">
268 <Offset x="0" y="64"/>
267 <Anchor point="BOTTOMLEFT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMLEFT">
268 <Offset x="0" y="-16"/>
269 269 </Anchor> </Anchor>
270 <Anchor point="BOTTOMRIGHT">
271 <Offset x="0" y="64"/>
270 <Anchor point="BOTTOMRIGHT" relativeTo="$parentHealthFrame" relativePoint="BOTTOMRIGHT">
271 <Offset x="0" y="-16"/>
272 </Anchor>
273 </Anchors>
274 </StatusBar>
275 <StatusBar name="$parentCastFrame" inherits="ChorusCastFrameTemplate">
276 <Anchors>
277 <Anchor point="TOPRIGHT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMRIGHT">
278 <Offset x="0" y="0"/>
279 </Anchor>
280 <Anchor point="TOPLEFT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMLEFT">
281 <Offset x="0" y="0"/>
282 </Anchor>
283 <Anchor point="BOTTOMLEFT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMLEFT">
284 <Offset x="0" y="-16"/>
285 </Anchor>
286 <Anchor point="BOTTOMRIGHT" relativeTo="$parentPowerFrame" relativePoint="BOTTOMRIGHT">
287 <Offset x="0" y="-16"/>
272 288 </Anchor> </Anchor>
273 289 </Anchors> </Anchors>
274 290 </StatusBar> </StatusBar>
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/vrtc/chorus

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/vrtc/chorus

Clone this repository using git:
git clone git://git.rocketgit.com/user/vrtc/chorus

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main