List of commits:
Subject Hash Author Date (UTC)
feat: Improve power indicator appearance fcd41d0a2cb7234c00f26ed2f0dc5c1183397d52 Vladyslav Bondarenko 2021-01-22 07:10:55
feat: Reduce update load 76a011715619c33caed714fec4161e53ecb1512c Vladyslav Bondarenko 2021-01-16 19:47:37
feat: Track more relevant effects f5f8803fa3cb59b43e144d9e53ea50fafcc23008 Vladyslav Bondarenko 2021-01-16 12:40:07
fix: Code base maintainance Add documentation and sanitise some arguments. 52e74dfb3f9fce8617ed4d4c63105966bb388daa Vladyslav Bondarenko 2021-01-12 13:07:49
fix: Typo The error did not affect performance. 216d3738bf4ef2de6be1361b7e2b57a6a7387f71 Vladyslav Bondarenko 2021-01-12 01:28:45
feat!: Show indicators correctly while in combat 0b6bf32b2a6ad2537b8cba766384e2d7f4b053d5 Vladyslav Bondarenko 2021-01-11 23:35:19
Initial commit 447e6a5ac2cc64f0f818663ba08681615327b19a Vladyslav Bondarenko 2021-01-11 20:26:55
Commit fcd41d0a2cb7234c00f26ed2f0dc5c1183397d52 - feat: Improve power indicator appearance
Make holy power indicator more contrast to improve readability.
Author: Vladyslav Bondarenko
Author date (UTC): 2021-01-22 07:10
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2021-01-22 07:10
Parent(s): d522be22f69c2915d4ef4397220c2700b238a4f3
Signer:
Signing key:
Signing status: N
Tree: f3734836e878b7f5f71692a3ad26847526e72d73
File Lines added Lines deleted
daybreak.lua 80 19
daybreak.toc 1 1
File daybreak.lua changed (mode: 100644) (index 11564d9..774ed4e)
... ... local function acceptUnitAura(button, eventCategory)
114 114 end end
115 115 end end
116 116
117 --[[--
118 Process UNIT_POWER event for holy power indicator.
119 @function acceptUnitPower
120 @tparam frame self this holy power indicator
121 ]]
122 local function acceptUnitPower(self)
123 assert (self ~= nil)
124
125 local unitDesignation = self.unit
126 assert (unitDesignation ~= nil)
127 assert ('string' == type(unitDesignation))
128 assert (string.len(unitDesignation) >= 2)
129 assert (string.len(unitDesignation) <= 256)
130
131 --[[ Assume the table is sorted appropriately ]]--
132 local t = self.children
133 assert (t ~= nil)
134 assert ('table' == type(t))
135 assert (#t >= 1)
136 assert (#t <= 256)
137
138 local maxQuantity = getMaxHolyPower()
139 assert (maxQuantity ~= nil)
140
141 --[[ Access the quantity of holy power point property of a given unit ]]--
142 local hppq = UnitPower(unitDesignation, SPELL_POWER_HOLY_POWER)
143 assert ('number' == type(hppq))
144 assert (hppq >= 0)
145 assert (hppq <= 1024)
146 hppq = math.abs(math.ceil(hppq))
147 assert (hppq <= maxQuantity)
148
149 --[[ Display the indicators according to the current unit state ]]--
150 local i = 0
151 while (i < hppq) do
152 i = i + 1
153 local p = t[i]
154 assert (p ~= nil)
155 p:Show()
156 end
157
158 while (i < maxQuantity) do
159 i = i + 1
160 local p = t[i]
161 assert (p ~= nil)
162 p:Hide()
163 end
164 end
165
166 --[[--
167 Access constant default indicator color.
168 @function getHolyPowerIndicatorColor
169 @return red green blue
170 ]]
171 local function getHolyPowerIndicatorColor()
172 return 153 / 255, 0 / 255, 102 / 255
173 end
174
117 175 --[[-- --[[--
118 176 Produce frame that tracks and displays given unit holy power. Produce frame that tracks and displays given unit holy power.
119 177 The new frame possesses custom attribute "unit". The new frame possesses custom attribute "unit".
 
... ... The new frame possesses custom attribute "unit".
124 182 @treturn frame newly allocated frame @treturn frame newly allocated frame
125 183 ]] ]]
126 184 local function createHolyPowerIndicator(frameName, parentFrame, unitDesignation) local function createHolyPowerIndicator(frameName, parentFrame, unitDesignation)
185 assert (frameName ~= nil)
186 assert ('string' == type(frameName))
187 assert (string.len(frameName) >= 2)
188 assert (string.len(frameName) <= 256)
189
127 190 assert (parentFrame ~= nil) assert (parentFrame ~= nil)
128 191
129 192 assert (unitDesignation ~= nil) assert (unitDesignation ~= nil)
 
... ... local function createHolyPowerIndicator(frameName, parentFrame, unitDesignation)
132 195 assert (string.len(unitDesignation) <= 256) assert (string.len(unitDesignation) <= 256)
133 196
134 197 local f = CreateFrame('FRAME', frameName, parentFrame) local f = CreateFrame('FRAME', frameName, parentFrame)
135 f.unit = unitDesignation
136 f:SetSize(64, 64)
198 local size = 24
199 local padding = 4
200 local maxQuantity = getMaxHolyPower()
201 f:SetSize(maxQuantity * (size + padding) + 4, size + padding + 4)
202
203 local background = f:CreateTexture(frameName .. 'Background', 'BACKGROUND')
204 background:SetAllPoints()
205 background:SetTexture(0, 0, 0, 0.64)
206 f.background = background
207
137 208 local t = {} local t = {}
138 209 local q = 0 local q = 0
139 210 local x = 0 local x = 0
140 local maxQuantity = getMaxHolyPower()
211 local y = 0
141 212 while (q < maxQuantity) do while (q < maxQuantity) do
142 213 q = q + 1 q = q + 1
143 214 local p = f:CreateTexture(frameName .. tostring(q), 'OVERLAY') local p = f:CreateTexture(frameName .. tostring(q), 'OVERLAY')
144 p:SetTexture(255 / 255, 204 / 255, 0 / 255, 1)
145 p:SetSize(24, 24)
146 p:SetPoint('BOTTOMLEFT', x * 28, 0)
215 p:SetTexture(getHolyPowerIndicatorColor())
216 p:SetSize(size, size)
217 p:SetPoint('BOTTOMLEFT', padding + x * (size + padding), y + padding)
147 218 p:Hide() p:Hide()
148 219 x = x + 1 x = x + 1
149 220 t[q] = p t[q] = p
150 221 end end
222
223 f.unit = unitDesignation
151 224 f.children = t f.children = t
152 225
153 226 f:RegisterEvent('UNIT_POWER_FREQUENT') f:RegisterEvent('UNIT_POWER_FREQUENT')
154 f:SetScript('OnEvent', function()
155 local i = 0
156 local hppq = UnitPower(unitDesignation, SPELL_POWER_HOLY_POWER)
157 while (i < maxQuantity) do
158 i = i + 1
159 local p = t[i]
160 if i <= hppq then
161 p:Show()
162 else
163 p:Hide()
164 end
165 end
166 end)
227 f:SetScript('OnEvent', acceptUnitPower)
167 228 return f return f
168 229 end end
169 230
File daybreak.toc changed (mode: 100644) (index 15577f9..9f7138f)
1 1 ##Interface: 40300 ##Interface: 40300
2 2 ##Title: Daybreak ##Title: Daybreak
3 ##Version: 0.0.5-SNAPSHOT
3 ##Version: 0.0.6-SNAPSHOT
4 4 ##Notes: Add paladin player buff indicator ##Notes: Add paladin player buff indicator
5 5 daybreak.xml daybreak.xml
6 6 daybreak.lua daybreak.lua
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/wowaddons

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

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

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