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 unit name b8358f834b4a9c25a6d057d91ed56e3b4d7dc320 Vladyslav Bondarenko 2023-08-15 18:21:12
feat!: Add power bar 654fe43cb55a0e440bdead43d86e3d49bf331c3a Vladyslav Bondarenko 2023-08-15 17:43:59
feat!: Add health bar 16bcad2d2169a7caa2a0f17513202673d178fa98 Vladyslav Bondarenko 2023-08-14 21:59:43
feat!: Add target aura tracker 96105088fc793845cde21639e0221b82de897262 Vladyslav Bondarenko 2023-08-12 21:49:26
Commit b8358f834b4a9c25a6d057d91ed56e3b4d7dc320 - feat!: Add unit name
Author: Vladyslav Bondarenko
Author date (UTC): 2023-08-15 18:21
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2023-08-15 18:21
Parent(s): 654fe43cb55a0e440bdead43d86e3d49bf331c3a
Signer:
Signing key: EFF9624877D25D02
Signing status: E
Tree: 713b5eefcba7d6ab4e27510505bbc039a08b181b
File Lines added Lines deleted
chorus.toc 1 0
src/ChorusTestFrame.xml 10 0
src/ChorusUnitNameFrameTemplate.lua 65 0
src/ChorusUnitNameFrameTemplate.xml 17 0
File chorus.toc changed (mode: 100644) (index 1096ef5..2d0e2e9)
... ... src\ChorusAuraFrameTemplate.xml
8 8 src\ChorusProgressFrameTemplate.xml src\ChorusProgressFrameTemplate.xml
9 9 src\ChorusHealthFrameTemplate.xml src\ChorusHealthFrameTemplate.xml
10 10 src\ChorusPowerFrameTemplate.xml src\ChorusPowerFrameTemplate.xml
11 src\ChorusUnitNameFrameTemplate.xml
11 12 src\ChorusTestFrame.xml src\ChorusTestFrame.xml
File src/ChorusTestFrame.xml changed (mode: 100644) (index 53a2369..df2ca1f)
17 17 </Anchor> </Anchor>
18 18 </Anchors> </Anchors>
19 19 <Frames> <Frames>
20 <Frame name="ChorusTestTargetUnitNameFrame" inherits="ChorusUnitNameFrameTemplate">
21 <Anchors>
22 <Anchor point="BOTTOMLEFT">
23 <Offset>
24 <AbsDimension x="0" y="110"/>
25 </Offset>
26 </Anchor>
27 </Anchors>
28 </Frame>
20 29 <Frame name="ChorusTestTargetHealthFrame" inherits="ChorusHealthFrameTemplate"> <Frame name="ChorusTestTargetHealthFrame" inherits="ChorusHealthFrameTemplate">
21 30 <Anchors> <Anchors>
22 31 <Anchor point="BOTTOMLEFT"> <Anchor point="BOTTOMLEFT">
 
66 75 ChorusTestTargetHealthFrame.strategy = 'UnitIsFriend'; ChorusTestTargetHealthFrame.strategy = 'UnitIsFriend';
67 76 ChorusTestTargetHealthFrame.unit = 'target'; ChorusTestTargetHealthFrame.unit = 'target';
68 77 ChorusTestTargetPowerFrame.unit = 'target'; ChorusTestTargetPowerFrame.unit = 'target';
78 ChorusTestTargetUnitNameFrame.unit = 'target';
69 79 ChorusTestTargetPowerFrame.strategy = 'UnitPowerType'; ChorusTestTargetPowerFrame.strategy = 'UnitPowerType';
70 80 </OnLoad> </OnLoad>
71 81 </Scripts> </Scripts>
File src/ChorusUnitNameFrameTemplate.lua added (mode: 100644) (index 0000000..97bcf88)
1 local RAID_CLASS_COLORS = RAID_CLASS_COLORS
2 local UnitClass = UnitClass
3 local UnitIsPlayer = UnitIsPlayer
4 local UnitName = UnitName
5
6 local Chorus = Chorus
7
8 local function unitNameEventProcessor(self)
9 assert(self ~= nil)
10
11 local label = self.label
12 assert(label ~= nil)
13
14 local unitDesignation = self.unit
15 assert('string' == type(unitDesignation))
16 unitDesignation = string.lower(strtrim(unitDesignation))
17 assert(string.len(unitDesignation) >= 1)
18 assert(string.len(unitDesignation) <= 256)
19
20 local name = UnitName(unitDesignation)
21 label:SetText(name)
22
23 local _, classDesignation = UnitClass(unitDesignation)
24 if not classDesignation or not UnitIsPlayer(unitDesignation) then
25 label:SetTextColor(1, 1, 1)
26 return
27 end
28
29 local map = RAID_CLASS_COLORS
30 assert(map ~= nil)
31 assert('table' == type(map))
32 local colorTuple = map[classDesignation]
33
34 local r = 1
35 local g = 1
36 local b = 1
37 if colorTuple then
38 assert('table' == type(colorTuple))
39 r = math.min(math.max(0, math.abs(colorTuple.r)), 1)
40 g = math.min(math.max(0, math.abs(colorTuple.g)), 1)
41 b = math.min(math.max(0, math.abs(colorTuple.b)), 1)
42 end
43
44 label:SetTextColor(r, g, b)
45 end
46
47 function Chorus.unitNameFrameMain(self)
48 assert(self ~= nil)
49
50 local label = _G[self:GetName() .. 'Text']
51 assert(label ~= nil)
52 self.label = label
53
54 self:SetScript('OnEvent', unitNameEventProcessor)
55
56 self:RegisterEvent('PARTY_CONVERTED_TO_RAID')
57 self:RegisterEvent('PARTY_MEMBERS_CHANGED')
58 self:RegisterEvent('PARTY_MEMBER_DISABLE')
59 self:RegisterEvent('PARTY_MEMBER_ENABLE')
60 self:RegisterEvent('PLAYER_ALIVE')
61 self:RegisterEvent('PLAYER_FOCUS_CHANGED')
62 self:RegisterEvent('PLAYER_LOGIN')
63 self:RegisterEvent('PLAYER_TARGET_CHANGED')
64 self:RegisterEvent('RAID_ROSTER_UPDATE')
65 end
File src/ChorusUnitNameFrameTemplate.xml added (mode: 100644) (index 0000000..90a0a7c)
1 <?xml version="1.0" encoding="UTF-8"?>
2 <Ui xmlns="http://www.blizzard.com/wow/ui/">
3 <Script file="ChorusUnitNameFrameTemplate.lua"/>
4 <Frame name="ChorusUnitNameFrameTemplate" virtual="true">
5 <Size>
6 <AbsDimension x="144" y="24" />
7 </Size>
8 <Layers>
9 <Layer level="OVERLAY">
10 <FontString name="$parentText" inherits="SystemFont_Shadow_Med1" setAllPoints="true"/>
11 </Layer>
12 </Layers>
13 <Scripts>
14 <OnLoad>Chorus.unitNameFrameMain(self);</OnLoad>
15 </Scripts>
16 </Frame>
17 </Ui>
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