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)
doc: raid frame profile generator script 22deb6f002463583ef5fd5c1acfcfb5777329aa8 Vladyslav Bondarenko 2024-06-15 21:55:01
feat: add fallback offline label a621e23fe7dc5668f0525dcc2bc60d916c2a1c14 Vladyslav Bondarenko 2024-06-15 19:08:05
fix: add test mocks for background and backdrop 2b22abbcb266bb02bded0633301e1669ed1b040d Vladyslav Bondarenko 2024-06-15 19:07:40
fix: render raid target icon above health cb950c903e6fe0a8078ea06473ce3a01157e55cc Vladyslav Bondarenko 2024-06-15 19:06:13
fix: shift solo frames left 4ba54a74c54b3bc68411fa8882ebd08a93587a1d Vladyslav Bondarenko 2024-06-15 19:04:37
fix!: render raid frames correctly cdb44a8f8ed5a356651d7119f8fd9441dda2c058 Vladyslav Bondarenko 2024-06-15 19:01:13
fix: disable raid profiles for now 41ed89dc4f78561e90ba999d00e95e0b1dc3f2a8 Vladyslav Bondarenko 2024-06-15 05:52:14
feat!: add raid group profiles 57b4b36b800beaf6843bc3cfc954340d914b71fa Vladyslav Bondarenko 2024-06-14 22:19:47
feat!: prepare nightly release 0.8.0 e11a3bbdfad85e4c4716e4ecfd3e7f5b8f009058 Vladyslav Bondarenko 2024-06-14 15:33:18
fix: globalize string constants cc5893ba83f388c0a58b183321f63867b10248ad Vladyslav Bondarenko 2024-06-14 15:12:35
feat: always show player frame 1eb20501d74ee931691f02abc31a176569a7d299 Vladyslav Bondarenko 2024-06-14 14:34:42
feat: add header background to larger units ef000eebb9ef5a8211f6aff47e2a1c38a3badf4a Vladyslav Bondarenko 2024-06-14 13:54:04
feat: unknown unit level is rendered as red f830dfcf22bf2f8e5c087de8f42a89f6733f5269 Vladyslav Bondarenko 2024-06-14 13:51:34
fix: make unit level text bold 2a4ea6baea2107a3f1ec8ab7bca4edb169a4575b Vladyslav Bondarenko 2024-06-14 13:51:01
feat: narrow backdrop for larger frames 77b080701c68bb8f6e353e15586f0e8063266d5c Vladyslav Bondarenko 2024-06-14 11:24:16
fix!: clever defaults for backdrop dimensions 2b894d724b4c9c97f5c27b98f43bf3e4616cb1ed Vladyslav Bondarenko 2024-06-14 10:58:30
fix!: render backdrop reliably for TOT frames 2f45f0afaee507cc5fc88a9892bf4474c644f173 Vladyslav Bondarenko 2024-06-14 09:55:18
fix: solo and party frames must never overlap 6776655fe59277688c4cb6b19d00f6dcf41cca89 Vladyslav Bondarenko 2024-06-14 09:13:23
fix: tiny unit frame border visual glitch 14090239c7535614ce4a02c7ee06d8204dd90a74 Vladyslav Bondarenko 2024-06-13 14:36:22
fix: generalize frame backdrop color picker 9960ac95ee03be3d8c93c49f773b850b057d9502 Vladyslav Bondarenko 2024-06-12 10:04:46
Commit 22deb6f002463583ef5fd5c1acfcfb5777329aa8 - doc: raid frame profile generator script
Author: Vladyslav Bondarenko
Author date (UTC): 2024-06-15 21:55
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2024-06-15 21:55
Parent(s): a621e23fe7dc5668f0525dcc2bc60d916c2a1c14
Signer:
Signing key: EFF9624877D25D02
Signing status: E
Tree: 70445deb65e87e2c1c3d122d8c36ba64b4af2ff2
File Lines added Lines deleted
GNUmakefile 0 0
bin/ChorusRaidFrameGenerator.lua 115 16
File GNUmakefile renamed from Makefile (similarity 100%)
File bin/ChorusRaidFrameGenerator.lua changed (mode: 100644) (index 542e0ee..17c7f35)
1 local mod = {}
1 --[[--
2 A command line program, that takes a few arguments and prints to standard
3 output ugly XML descriptors.
4
5 This script parametrizes XML descriptor template for raid frame GUI widget,
6 that is only useful for `chorus` project.
7
8 There are several plausible configurations of the raid frame a user may
9 require. At least one per instance type, that is, arena, battleground, raid and
10 dungeon or party. Possibly more. The user will likely require to switch between
11 those profiles frequently and automatically.
12
13 The original intention of the project is to have the add-on come pre-configured
14 by the developer, and not require configuration by the user. Hence the need to
15 define a several useful raid frame profiles.
16
17 This script is a tool involved in producing different, but uniform raid
18 profiles, that are implemented by the project. The primary parameters are the
19 button template and button dimensions.
20
21 The unit button templates, that are hard coded in this script, are declared in
22 `src/ChorusRaidFrameTemplate.xml`. The specialization of raid profiles is
23 implemented in those virtual frame templates. This script only arranges the
24 concrete instances of buttons in a grid using XML descriptors.
25
26 The script is intended to be used by build orchestration tools, like `make` or
27 `gradle` or `ant`, rather than called manually.
28
29 The game engine loads XML descriptors quicker than Lua scripts. Therefore,
30 complex widgets, like raid frames, benefit from being declared with XML rather
31 than Lua. This does not improve responsiveness, however. This approach is
32 largely an experiment.
33
34 The usage shows how to execute the script on the command line. The first token
35 is the Lua executable. The second token is the script itself, assuming the
36 `chorus` source directory is the current working directory. The following
37 tokens are arguments for the script. The order is significant. See `function
38 emitRaidFrame`. Finally, the output is redirected to a file.
39
40 Formatting and validation of the output XML descriptor is the responsibility of
41 other tools, like `xmllint`.
42
43 @see emitRaidFrame
44
45 @usage lua bin/ChorusRaidFrameGenerator.lua ChorusTinyRaidFrame ChorusTinyRaidUnitFrameTemplate 64 16 > ChorusTinyRaidFrame.xml
2 46
47 @script ChorusRaidFrameGenerator
48
49 @alias mod
50 ]]
51
52 ChorusRaidFrameGenerator = {}
53
54 local mod = ChorusRaidFrameGenerator
3 55
4 56 local header = [[ local header = [[
5 57 <?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
 
... ... local footer = [[
49 101 </Frame> </Frame>
50 102 </Ui>]] </Ui>]]
51 103
104 --[[--
105 Print a snippet of XML, that describes a button for a single raid member.
106
107 @function emitRaidButton
108
109 @tparam string buttonName frame designation, expected to be globally unique
110
111 @tparam string buttonTemplate virtual frame designation, all buttons in a
112 specific raid frame profile are expected to be uniform and share a single
113 template
114
115 @tparam int buttonId positive integer and not zero, a serial number of the
116 button, expected to be unique per raid frame profile
117
118 @tparam number buttonX offset from origin, that is bottom left corner, to the right
119
120 @tparam number buttonY offset from origin, that is bottom left corner, upwards
121
122 @tparam string unitDesignation unit designation, that is a raid member, like
123 `raid13`, each button is expected expected to map to units 1:1
124
125 @return nothing, the output is printed to standard output
126 ]]
52 127 function mod.emitRaidButton(buttonName, buttonTemplate, buttonId, buttonX, buttonY, unitDesignation) function mod.emitRaidButton(buttonName, buttonTemplate, buttonId, buttonX, buttonY, unitDesignation)
53 128 assert(buttonName ~= nil) assert(buttonName ~= nil)
54 129 assert('string' == type(buttonName)) assert('string' == type(buttonName))
 
... ... function mod.emitRaidGroup(raidFrameName, buttonTemplate, buttonWidth,
173 248 end end
174 249 end end
175 250
251 --[[--
252 Print to standard output a valid XML descriptor for a raid frame profile, with
253 given arguments.
254
255 A raid frame consists by default of forty buttons arranged in a grid. First
256 button is the bottom left most corner of the grid, growing to the right and up.
257
258 A raid frame can be split into two blocks of twenty buttons, instead of one
259 block of forty. See the notes in the source code.
260
261 @function emitRaidFrame
262
263 @tparam string raidFrameName raid frame designation token, expected to be
264 globally unique
265
266 @tparam string buttonTemplate virtual frame template designation token, that
267 every button in the raid frame profile will inherit from
268
269 @tparam number buttonWidth positive and not zero integer, width of a single button
270
271 @tparam number buttonWidth positive and not zero integer, width of a single button
272
273 @return nothing, the output is printed to standard output
274 ]]
176 275 function mod.emitRaidFrame(raidFrameName, buttonTemplate, buttonWidth, buttonHeight) function mod.emitRaidFrame(raidFrameName, buttonTemplate, buttonWidth, buttonHeight)
177 276 assert(raidFrameName ~= nil) assert(raidFrameName ~= nil)
178 277 assert('string' == type(raidFrameName)) assert('string' == type(raidFrameName))
 
... ... function mod.emitRaidFrame(raidFrameName, buttonTemplate, buttonWidth, buttonHei
203 302
204 303 local groupQuantity = math.ceil(raidSizeMax / groupSizeMax) local groupQuantity = math.ceil(raidSizeMax / groupSizeMax)
205 304
206 --[[ The table of raid buttons grows vertically from bottom left to top
207 right, indefinitely. However, when the limit of rows is reached, the
208 vertical position of the cursor is reset, and horizonal position is
209 offset, as to allow the table to grow horizontally. The purpose is to
210 save visual screen space for the end user. ]]--
211
212 --[[ Effectively, by default, the raid frame is split into two blocks
213 of 4 groups x 5 members. ]]--
305 --[[ Effectively, when `blockQuantity = 2`, the raid frame is split
306 into two blocks of 4 groups x 5 members. ]]--
214 307
215 308 local blockQuantity = 1 local blockQuantity = 1
216 309 assert(blockQuantity > 0) assert(blockQuantity > 0)
217 310 blockQuantity = math.ceil(math.abs(blockQuantity)) blockQuantity = math.ceil(math.abs(blockQuantity))
218 311
312 --[[ Margin to leave space for group number labels. ]]--
313
219 314 local marginLeft = 16 local marginLeft = 16
220 315 local padding = 6 local padding = 6
221 316 assert(padding >= 0) assert(padding >= 0)
 
... ... function mod.emitRaidFrame(raidFrameName, buttonTemplate, buttonWidth, buttonHei
258 353 print(footer) print(footer)
259 354 end end
260 355
261 function mod.main(...)
262 mod.emitRaidFrame(...)
263 end
264
265 ChorusRaidFrameGenerator = mod
356 --[[--
357 Process command line arguments with builtin global variable `arg`.
266 358
267 do
359 @function mod.main
360 @see emitRaidFrame
361 @return nothing, prints to standard output
362 ]]
363 function mod.main()
268 364 if arg ~= nil and 'table' == type(arg) then if arg ~= nil and 'table' == type(arg) then
269 mod.main(unpack(arg))
365 return mod.emitRaidFrame(unpack(arg))
270 366 end end
367 end
271 368
369 do
370 mod.main()
272 371 return mod return mod
273 372 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