List of commits:
Subject Hash Author Date (UTC)
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 0b6bf32b2a6ad2537b8cba766384e2d7f4b053d5 - feat!: Show indicators correctly while in combat
Secure button template cannot be toggled while in combat.
Therefore remove the dependency on the secure template.
The indicators may no longer be canceled by clicking on them as a
result. This ensures that frames are displayed correctly during combat.
Author: Vladyslav Bondarenko
Author date (UTC): 2021-01-11 23:35
Committer name: Vladyslav Bondarenko
Committer date (UTC): 2021-01-11 23:35
Parent(s): 447e6a5ac2cc64f0f818663ba08681615327b19a
Signer:
Signing key:
Signing status: N
Tree: fe8bdd6fda18e7a147ea0a5269cea4de9214fade
File Lines added Lines deleted
daybreak.lua 29 24
daybreak.toc 1 1
File daybreak.lua changed (mode: 100644) (index e99adab..a5b992b)
... ... local function acceptUnitAura(button, eventCategory)
6 6 assert (button ~= nil) assert (button ~= nil)
7 7 assert (eventCategory ~= nil) assert (eventCategory ~= nil)
8 8
9 local auraName = button:GetAttribute('spell')
9 local auraName = button.spell
10 10 assert (auraName ~= nil) assert (auraName ~= nil)
11 11
12 local unitDesignation = button:GetAttribute('unit')
12 local unitDesignation = button.unit
13 13 assert (unitDesignation ~= nil) assert (unitDesignation ~= nil)
14 14
15 local name, rank, icon, count, debuffType, duration, expirationInstance,
16 unitCaster, isStealable, shouldConsolidate,
17 spellId = UnitBuff(unitDesignation, auraName)
18 if nil == expirationInstance then
19 expirationInstance = 0
20 end
21 local now = GetTime()
22 if not name or not expirationInstance then
23 button:Hide()
24 elseif name and expirationInstance > now then
25 local elapsedDuration = expirationInstance - now
26 local durationRemaining = duration - elapsedDuration
27 button:SetText(durationRemaining)
15 local name, _, icon = UnitBuff(unitDesignation, auraName)
16 if name then
28 17 --[[ FIXME Apply graphics only once instead of every aura update ]]-- --[[ FIXME Apply graphics only once instead of every aura update ]]--
29 18 button:SetNormalTexture(icon) button:SetNormalTexture(icon)
30 19 button:Show() button:Show()
 
... ... end
36 25 local function applyUpdate(button, updateDuration) local function applyUpdate(button, updateDuration)
37 26 assert (button ~= nil) assert (button ~= nil)
38 27
39 local auraName = button:GetAttribute('spell')
28 local auraName = button.spell
40 29 assert (auraName ~= nil) assert (auraName ~= nil)
41 30
42 local unitDesignation = button:GetAttribute('unit')
31 local unitDesignation = button.unit
43 32 assert (unitDesignation ~= nil) assert (unitDesignation ~= nil)
44 33
45 34 local name, _, _, _, _, duration, expirationInstance = UnitBuff(unitDesignation, auraName) local name, _, _, _, _, duration, expirationInstance = UnitBuff(unitDesignation, auraName)
 
... ... local function createHolyPowerIndicator(frameName, parentFrame, unitDesignation)
99 88 return f return f
100 89 end end
101 90
102 local function createButton(buttonName, parentFrame, auraName)
91 --[[--
92 @function createButton
93 @param buttonName string
94 @param parentFrame
95 @param localizedSpellName string
96 @return button frame
97 @treturn spell string
98 @treturn unit string
99 ]]
100 local function createButton(buttonName, parentFrame, localizedSpellName)
103 101 assert (buttonName ~= nil) assert (buttonName ~= nil)
102 assert ('string' == type(buttonName))
103 assert (string.len(buttonName) >= 2)
104 assert (string.len(buttonName) <= 256)
105
104 106 assert (parentFrame ~= nil) assert (parentFrame ~= nil)
105 assert (auraName ~= nil)
106 107
107 local button = CreateFrame('BUTTON', buttonName, parentFrame, 'SecureActionButtonTemplate')
108 assert (localizedSpellName ~= nil)
109 assert ('string' == type(localizedSpellName))
110 assert (string.len(localizedSpellName) >= 2)
111 assert (string.len(localizedSpellName) <= 256)
112
113 local button = CreateFrame('BUTTON', buttonName, parentFrame)
108 114 local size = getDefaultButtonSize() local size = getDefaultButtonSize()
109 115 button:SetSize(size, size) button:SetSize(size, size)
110 116
 
... ... local function createButton(buttonName, parentFrame, auraName)
113 119 text:SetAllPoints() text:SetAllPoints()
114 120
115 121 button:SetFontString(text) button:SetFontString(text)
116 button:SetText('?')
122 button:SetText(nil)
117 123
118 button:SetAttribute('type', 'cancelaura')
119 button:SetAttribute('spell', auraName)
120 button:SetAttribute('unit', 'player')
124 button.spell = localizedSpellName
125 button.unit = 'player'
121 126
122 127 button:RegisterEvent('UNIT_AURA') button:RegisterEvent('UNIT_AURA')
123 128 button:SetScript('OnEvent', acceptUnitAura) button:SetScript('OnEvent', acceptUnitAura)
File daybreak.toc changed (mode: 100644) (index 92522a2..bf1dde1)
1 1 ##Interface: 40300 ##Interface: 40300
2 2 ##Title: Daybreak ##Title: Daybreak
3 ##Version: 0.0.0-SNAPSHOT
3 ##Version: 0.0.1-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