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)
fix!: update pet frame correctly 3d9a3ac39962ca2e39f7a330abe74a229b822e4e Vladyslav Bondarenko 2025-02-09 00:56:36
feat: add pet frame stub 4cbc49b6720943fb9929f3bce34887d425c36629 Vladyslav Bondarenko 2025-02-08 23:21:15
fix: trigger unit button on mouse down 730a9f8483b0ccf6d8bccae71c1ab83bbae08920 Vladyslav Bondarenko 2025-02-08 18:41:46
doc: fix minor documentation markup issues fc0a3ac65c9a4682025639d416083bbfc690023f Vladyslav Bondarenko 2025-02-05 11:40:51
fix: move role widget 2832bd50f728bb89412aff98d8d1776ce102fb92 Vladyslav Bondarenko 2025-02-04 20:02:58
feat: aura duration of less than one second 9d2be37d502e438ebb1c79bc9278fd7f189ec8d3 Vladyslav Bondarenko 2025-02-04 19:29:50
feat!: add ready check widget 54f77e083a30b5d2ea3d7c0facc4f04ae5a50524 Vladyslav Bondarenko 2025-02-04 18:56:01
fix: add numerical identifiers to raid frames 7805568e6500ba652f5489a84d78697dc81d1017 Vladyslav Bondarenko 2025-02-04 18:54:04
fix: remove generated XML from small raid 9ec89db68e9d2304df118b2500e8675a941e699c Vladyslav Bondarenko 2025-02-04 18:52:50
fix: unit backdrop dimensions d677e35bebff554b26c4240c1a2cb2b0327f1cf3 Vladyslav Bondarenko 2025-02-03 21:10:07
fix: remove XML generators 0430f8d2cc9c7cf5ee22ae518f42e2ce85d5d5e7 Vladyslav Bondarenko 2025-02-03 20:20:52
feat: change aura tooltip graphics bf7cb7b9b19ffb4850d8e72d8352af75a5bdccfa Vladyslav Bondarenko 2025-02-02 22:52:58
fix!: aura tooltip aura buttons clearly visible dcebd82df00d5daee8d008c625e71d13c8da8c37 Vladyslav Bondarenko 2025-02-02 21:26:15
feat: bump version to 0.12.0-10 fffe025cfcfbe5ec0356d34cffdef1bfb62ea0af Vladyslav Bondarenko 2025-02-02 18:57:49
feat: allow aura tooltip to be dragged d4d699efa596b5bc5004873b3e41b50a09f4f3db Vladyslav Bondarenko 2025-02-02 18:56:00
feat!: create singleton aura tooltip 8e8e798543ef100a71ba2a9d212e66b1ddd667ab Vladyslav Bondarenko 2025-02-02 00:04:55
fix: show auras over role widgets 3bb62c88147af0ee522f4ce963ce206c315f4c9a Vladyslav Bondarenko 2025-02-01 21:27:33
fix: sanitize FrameXML fa5b0bbc1db073aa06e59d9bf03eb8d471a084b2 Vladyslav Bondarenko 2025-02-01 19:20:16
fix: make combat widget more visible 4b01d27fa7eeef55a6dcb866ec30641ee80e6f5b Vladyslav Bondarenko 2025-02-01 18:02:43
fix: make player roles more visible e28bbf987659ac717962de851226aa33409f472a Vladyslav Bondarenko 2025-02-01 18:02:21
Commit 3d9a3ac39962ca2e39f7a330abe74a229b822e4e - fix!: update pet frame correctly
Pet frame will trigger it's refresh routine correctly when pets are
added or removed, instead of only sometimes.

There is still a stub frame. Next step is to integrate pet frame with
old raid or party frame.

Next is to allow pet frame to adjust dimensions dynamically.

Next is to use this system for auras and other units, maybe.
Author: Vladyslav Bondarenko
Author date (UTC): 2025-02-09 00:56
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2025-02-09 00:56
Parent(s): 4cbc49b6720943fb9929f3bce34887d425c36629
Signer:
Signing key: EFF9624877D25D02
Signing status: E
Tree: 74dc78fa53202842c18c96c7180948bdde722193
File Lines added Lines deleted
src/ChorusPetFrameTemplate.lua 39 46
File src/ChorusPetFrameTemplate.lua changed (mode: 100644) (index b9070f2..4cb3dac)
... ... local ChorusPetFrameSecureHandler = ChorusPetFrameSecureHandler
4 4 local strtrim = strtrim local strtrim = strtrim
5 5
6 6 local CreateFrame = CreateFrame local CreateFrame = CreateFrame
7 local SecureCmdOptionParse = SecureCmdOptionParse
8 7
9 local function petButtonFactory(petFrame, petButtonTemplate)
8 local function petButtonFactory(petFrame, petButtonTemplate, secureHandler, secureScriptBody)
10 9 assert(petFrame ~= nil) assert(petFrame ~= nil)
11 10
12 11 if not petButtonTemplate then if not petButtonTemplate then
13 12 petButtonTemplate = 'ChorusPetButtonTemplate' petButtonTemplate = 'ChorusPetButtonTemplate'
14 13 end end
15 14
15 assert(secureHandler ~= nil)
16
17 assert(secureScriptBody ~= nil)
18
16 19 assert(petButtonTemplate ~= nil) assert(petButtonTemplate ~= nil)
17 20 assert('string' == type(petButtonTemplate)) assert('string' == type(petButtonTemplate))
18 21 petButtonTemplate = strtrim(petButtonTemplate) petButtonTemplate = strtrim(petButtonTemplate)
 
... ... local function petButtonFactory(petFrame, petButtonTemplate)
39 42 local u = 'raidpet' .. tostring(i) local u = 'raidpet' .. tostring(i)
40 43 b:SetAttribute('unit', u) b:SetAttribute('unit', u)
41 44 b:SetID(i) b:SetID(i)
42 end
43 end
44 45
45 local function petFrameSecureCmdFactory()
46 local secureCmd = ''
46 assert(b:IsProtected())
47 47
48 secureCmd = '[@party1pet,exists] party1pet; ' .. secureCmd
49 secureCmd = '[@party2pet,exists] party2pet; ' .. secureCmd
50 secureCmd = '[@party3pet,exists] party3pet; ' .. secureCmd
51 secureCmd = '[@party4pet,exists] party4pet; ' .. secureCmd
48 local secureCmd = string.format('[@%s,exists] 1; [@%s,noexists] 0;', u, u)
49 --print(secureCmd, '|', SecureCmdOptionParse(secureCmd))
50 RegisterStateDriver(b, 'unitexists', secureCmd)
52 51
53 local i = 0
54 local MAX_RAID_MEMBERS = MAX_RAID_MEMBERS or 40;
55 while(i < MAX_RAID_MEMBERS) do
56 i = i + 1
57 secureCmd = string.format('[@raidpet%d,exists] raidpet%d; ', i, i) .. secureCmd
52 secureHandler:WrapScript(b, 'OnAttributeChanged', secureScriptBody)
58 53 end end
59
60 return secureCmd
61 end
62
63 function Chorus.unpepe()
64 local secureCmd = petFrameSecureCmdFactory()
65 print('SecureCmdOptionParse', SecureCmdOptionParse(secureCmd))
66 end
67
68 function Chorus.opopo()
69 local secureCmd = petFrameSecureCmdFactory()
70 print('SecureCmdOptionParse', secureCmd)
71 54 end end
72 55
73 56 function Chorus.petFrameMain(petFrame) function Chorus.petFrameMain(petFrame)
74 57 assert(petFrame ~= nil) assert(petFrame ~= nil)
75 print('pipirwa1')
76
77 petButtonFactory(petFrame)
78 58
79 59 petFrame:RegisterEvent('PARTY_CONVERTED_TO_RAID') petFrame:RegisterEvent('PARTY_CONVERTED_TO_RAID')
80 60 petFrame:RegisterEvent('PARTY_MEMBERS_CHANGED') petFrame:RegisterEvent('PARTY_MEMBERS_CHANGED')
 
... ... function Chorus.petFrameMain(petFrame)
88 68 Wrap state listener for buttons instead. Wrap state listener for buttons instead.
89 69 ]] ]]
90 70
91 local secureCmd = petFrameSecureCmdFactory()
92 RegisterStateDriver(secureHandler, 'raidpet', secureCmd)
71 --[[-- @fixme Replace hardcoded button dimensions.
72 ]]
93 73
94 74 local secureScriptBody = [[ local secureScriptBody = [[
95 print(self:GetName(), owner:GetName(), name, value)
75 -- When attribute changed, given it was not 'unitexists', exit.
76 -- When script executed explicitly, ignore the check and continue.
77 -- WARNING: Filtering by attribute change is required. Otherwise it may crash the game.
78 if name and name ~= 'state-unitexists' then
79 return
80 end
96 81
97 local petFrame = self:GetFrameRef('ChorusPetFrame')
82 local petFrame = owner:GetFrameRef('ChorusPetFrame')
83 if not petFrame then
84 print('ChorusPetFrameTemplate.lua: could not find pet frame')
85 return
86 end
98 87
99 88 local buttonWidth = 64 local buttonWidth = 64
100 89 local buttonHeight = 16 local buttonHeight = 16
101 90
102 local i = 0
103 91 local column = 0 local column = 0
104 92 local row = 0 local row = 0
93
94 local i = 0
105 95 local t = newtable() local t = newtable()
106 96 petFrame:GetChildList(t) petFrame:GetChildList(t)
107 while(i < #t) do
97 while (i < #t) do
108 98 i = i + 1 i = i + 1
99
109 100 local b = t[i] local b = t[i]
101 if not b then
102 print('ChorusPetFrameTemplate.lua: empty child')
103 return
104 end
105
110 106 local u = b:GetAttribute('unit') local u = b:GetAttribute('unit')
111 107 if UnitExists(u) then if UnitExists(u) then
112 local x = buttonWidth * column
113 local y = buttonHeight * row
114 -- Relative point is required.
115 -- Relative frame must be protected also.
116 b:SetPoint('BOTTOMLEFT', petFrame, 'BOTTOMLEFT', x, y)
108 -- WARNING: Toggling visibility triggers attribute change.
117 109 b:Show() b:Show()
118 print(b:GetName(), u, x, y)
110
111 local x = column * buttonWidth
112 local y = row * buttonHeight
113 b:SetPoint('BOTTOMLEFT', petFrame, 'BOTTOMLEFT', x, y)
119 114 column = column + 1 column = column + 1
120 115 if column >= 5 then if column >= 5 then
121 116 column = 0 column = 0
 
... ... function Chorus.petFrameMain(petFrame)
127 122 end end
128 123 ]] ]]
129 124
130 secureHandler:WrapScript(secureHandler, 'OnAttributeChanged', secureScriptBody)
125 petButtonFactory(petFrame, 'ChorusPetButtonTemplate', secureHandler, secureScriptBody)
131 126
132 --[[ Initialize frames at login. ]]--
127 --[[ Initialize frames at login. Only works out of combat. ]]--
133 128 secureHandler:Execute(secureScriptBody) secureHandler:Execute(secureScriptBody)
134
135 print('pipirwa2')
136 129 end end
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