├── virus-example.png ├── old ├── README.md ├── custom.abbreviate.lua ├── custom.namecolours.lua ├── custom.barcolours.lua ├── custom.lowhealthspecs.lua ├── custom.textinside.lua ├── custom.fliptext.lua ├── deficit-health.patch ├── custom.lowhealthcolours.lua └── custom.mindharvest.lua ├── Kui_Nameplates_Custom.zip ├── this-is-the-raw-link.png ├── Kui_Nameplates_OldTextures.zip ├── Kui_Nameplates_OldTextures ├── target-arrow.tga ├── threat-bracket.tga ├── Kui_Nameplates_OldTextures.toc └── custom.lua ├── Kui_Nameplates_Custom ├── Kui_Nameplates_Custom.toc └── custom.lua ├── custom.hide-aura-count.lua ├── custom.avoid-fade-hostile.lua ├── custom.detection-icon.lua ├── custom.two-health-values.lua ├── custom.hide-friends-in-instances.lua ├── README.md ├── custom.health-text-mods.lua ├── custom.target-target-glow.lua ├── custom.leftie.lua ├── custom.simple-aura-mods.lua ├── custom.explosives.lua ├── custom.target-name.lua ├── custom.mythicplus.lua └── custom.name-and-target-colour.lua /virus-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kesava-wow/kuinameplates-customs/HEAD/virus-example.png -------------------------------------------------------------------------------- /old/README.md: -------------------------------------------------------------------------------- 1 | These scripts were made for pre-Legion KuiNameplates and will not work with KuiNameplates2. 2 | -------------------------------------------------------------------------------- /Kui_Nameplates_Custom.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kesava-wow/kuinameplates-customs/HEAD/Kui_Nameplates_Custom.zip -------------------------------------------------------------------------------- /this-is-the-raw-link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kesava-wow/kuinameplates-customs/HEAD/this-is-the-raw-link.png -------------------------------------------------------------------------------- /Kui_Nameplates_OldTextures.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kesava-wow/kuinameplates-customs/HEAD/Kui_Nameplates_OldTextures.zip -------------------------------------------------------------------------------- /Kui_Nameplates_OldTextures/target-arrow.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kesava-wow/kuinameplates-customs/HEAD/Kui_Nameplates_OldTextures/target-arrow.tga -------------------------------------------------------------------------------- /Kui_Nameplates_OldTextures/threat-bracket.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kesava-wow/kuinameplates-customs/HEAD/Kui_Nameplates_OldTextures/threat-bracket.tga -------------------------------------------------------------------------------- /Kui_Nameplates_OldTextures/Kui_Nameplates_OldTextures.toc: -------------------------------------------------------------------------------- 1 | ## Interface: 80205 2 | ## Author: Kesava 3 | ## Title: Kui |cff9966ffNameplates|r Old Textures 4 | ## Dependencies: Kui_Nameplates_Core 5 | 6 | custom.lua 7 | -------------------------------------------------------------------------------- /Kui_Nameplates_Custom/Kui_Nameplates_Custom.toc: -------------------------------------------------------------------------------- 1 | ## Interface: 80205 2 | ## Author: Kesava 3 | ## Title: Kui |cff9966ffNameplates|r Custom Injector 4 | ## Notes: Custom code injector for Kui Nameplates Core. 5 | ## Dependencies: Kui_Nameplates_Core 6 | 7 | custom.lua 8 | -------------------------------------------------------------------------------- /custom.hide-aura-count.lua: -------------------------------------------------------------------------------- 1 | local AURAS = { 2 | [980] = true, 3 | } 4 | -- below lines should be left alone ############################################ 5 | local folder,ns=... 6 | local addon = KuiNameplates 7 | local core = KuiNameplatesCore 8 | 9 | local mod = addon:NewPlugin('HideAuraCount',101,5) 10 | if not mod then return end 11 | 12 | local function PostDisplayAuraButton(frame,button) 13 | if AURAS[button.spellid] then 14 | button.count:Hide() 15 | end 16 | end 17 | 18 | function mod:Initialise() 19 | self:AddCallback('Auras','PostDisplayAuraButton',PostDisplayAuraButton) 20 | end 21 | -------------------------------------------------------------------------------- /old/custom.abbreviate.lua: -------------------------------------------------------------------------------- 1 | local kn = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') 2 | local mod = kn:NewModule('CustomInjector', 'AceEvent-3.0') 3 | local function abbreviated_SetName(self) 4 | self:orig_SetName() 5 | 6 | if not self.name.text:match(' %(%*%)$') then 7 | self.name.abbreviated = self.name.text:gsub('(%S+) ', function(t) 8 | return t:sub(1,1)..'.' 9 | end) 10 | self.name:SetText(self.name.abbreviated) 11 | end 12 | end 13 | function mod:PostCreate(msg,f) 14 | f.orig_SetName = f.SetName 15 | f.SetName = abbreviated_SetName 16 | end 17 | mod:RegisterMessage('KuiNameplates_PostCreate', 'PostCreate') 18 | -------------------------------------------------------------------------------- /old/custom.namecolours.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- custom.lua for Kui_Nameplates 3 | -- By Kesava at curse.com 4 | -- 5 | -- changes the name text colour of friendly/enemeny units. 6 | -- this functionality will be removed as a built in option soon, because it's 7 | -- extremely easy to reproduce in custom.lua. Like this. 8 | ]] 9 | local kn = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') 10 | local mod = kn:NewModule('CustomInjector', 'AceEvent-3.0') 11 | function mod:PostShow(msg, frame) 12 | if frame.friend then 13 | frame.name:SetTextColor(0,1,0) 14 | else 15 | frame.name:SetTextColor(1,0,0) 16 | end 17 | end 18 | mod:RegisterMessage('KuiNameplates_PostShow', 'PostShow') 19 | -------------------------------------------------------------------------------- /custom.avoid-fade-hostile.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- Avoid fading hostile units 3 | --]] 4 | local folder,ns=... 5 | local addon = KuiNameplates 6 | local core = KuiNameplatesCore 7 | 8 | local mod = addon:NewPlugin('AvoidFadeHostile',101,5) 9 | if not mod then return end 10 | 11 | local plugin_fading 12 | 13 | function mod.Fading_FadeRulesReset() 14 | plugin_fading:AddFadeRule(function(f) 15 | return not f.state.friend and 1 16 | end,1) 17 | end 18 | function mod:OnEnable() 19 | self:AddCallback('Fading','FadeRulesReset',self.Fading_FadeRulesReset) 20 | self.Fading_FadeRulesReset() 21 | end 22 | function mod:Initialise() 23 | plugin_fading = addon:GetPlugin('Fading') 24 | end 25 | -------------------------------------------------------------------------------- /old/custom.barcolours.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- custom.lua for Kui_Nameplates 3 | -- By Kesava at curse.com 4 | -- 5 | -- changes colour of health bars for specific units named in the in the table 6 | ]] 7 | local kn = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') 8 | local mod = kn:NewModule('CustomInjector', 'AceEvent-3.0') 9 | 10 | local units = { 11 | ['Stanzilla'] = { 1, 0, 0 } 12 | } 13 | local PRIORITY = 3 -- set above 10 to override tank mode colour 14 | 15 | function mod:PostShow(msg, frame) 16 | local mycol = units[frame.name.text] 17 | if mycol then 18 | frame:SetHealthColour(PRIORITY, unpack(mycol)) 19 | end 20 | end 21 | mod:RegisterMessage('KuiNameplates_PostShow', 'PostShow') 22 | -------------------------------------------------------------------------------- /custom.detection-icon.lua: -------------------------------------------------------------------------------- 1 | local folder,ns=... 2 | local addon = KuiNameplates 3 | local core = KuiNameplatesCore 4 | 5 | local mod = addon:NewPlugin('DetectionIcon',101,5) 6 | if not mod then return end 7 | 8 | function mod:Create(f) 9 | local detection = f.handler:CreateAuraFrame({ 10 | max = 1, 11 | size = 24, 12 | squareness = 1, 13 | point = {'BOTTOMLEFT','LEFT','RIGHT'}, 14 | rows = 1, 15 | filter = 'HELPFUL', 16 | whitelist = { 17 | [203761] = true, 18 | [213486] = true, 19 | }, 20 | }) 21 | 22 | detection:SetFrameLevel(0) 23 | detection:SetWidth(24) 24 | detection:SetHeight(24) 25 | detection:SetPoint('RIGHT',f.bg,'LEFT',-1,0) 26 | 27 | f.DetectionIcon = detection 28 | end 29 | 30 | function mod:Initialise() 31 | self:RegisterMessage('Create') 32 | end 33 | -------------------------------------------------------------------------------- /old/custom.lowhealthspecs.lua: -------------------------------------------------------------------------------- 1 | local addon = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') 2 | local mod = addon:NewModule('LowHealthSpecs', addon.Prototype, 'AceEvent-3.0') 3 | 4 | local low_health_specs = { 5 | [254] = 35, -- marksmanship 6 | } 7 | local low_health_default = 20 8 | 9 | function mod:Update() 10 | local spec_index = GetSpecialization() 11 | if not spec_index then return end 12 | local spec = GetSpecializationInfo(spec_index) 13 | if not spec then return end 14 | 15 | if low_health_specs[spec] then 16 | addon.db.profile.general.lowhealthval = low_health_specs[spec] 17 | else 18 | addon.db.profile.general.lowhealthval = low_health_default 19 | end 20 | 21 | addon:ConfigChanged({'general','lowhealthval'},addon.db.profile) 22 | end 23 | function mod:OnInitialize() 24 | self:RegisterEvent('PLAYER_SPECIALIZATION_CHANGED', 'Update') 25 | self:RegisterEvent('PLAYER_LOGIN', 'Update') 26 | end 27 | -------------------------------------------------------------------------------- /old/custom.textinside.lua: -------------------------------------------------------------------------------- 1 | local kn = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') 2 | local mod = kn:NewModule('CustomInjector', 'AceEvent-3.0') 3 | function mod:PostShow(msg, frame) 4 | frame.level:ClearAllPoints() 5 | frame.name:ClearAllPoints() 6 | frame.health.p:ClearAllPoints() 7 | 8 | frame.level:SetJustifyV('MIDDLE') 9 | frame.name:SetJustifyH('LEFT') 10 | 11 | frame.name:SetJustifyV('MIDDLE') 12 | frame.name:SetJustifyH('LEFT') 13 | 14 | frame.health.p:SetJustifyV('MIDDLE') 15 | frame.health.p:SetJustifyH('RIGHT') 16 | 17 | frame.health.p:SetPoint('RIGHT', -3.5, -1.5) 18 | 19 | if frame.level:IsShown() then 20 | frame.level:SetPoint('LEFT', 3.5, -1.5) 21 | frame.name:SetPoint('LEFT', frame.level, 'RIGHT') 22 | else 23 | frame.name:SetPoint('LEFT', 3.5, -1.5) 24 | end 25 | 26 | frame.name:SetPoint('RIGHT', frame.health.p, 'LEFT') 27 | end 28 | mod:RegisterMessage('KuiNameplates_PostShow', 'PostShow') 29 | -------------------------------------------------------------------------------- /Kui_Nameplates_Custom/custom.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- Custom code injector template for Kui_Nameplates_Core 3 | --]] 4 | local folder,ns=... 5 | local addon = KuiNameplates 6 | local core = KuiNameplatesCore 7 | 8 | local mod = addon:NewPlugin('CustomInjector',101) 9 | if not mod then return end 10 | 11 | -- create ###################################################################### 12 | function mod:Create(frame) 13 | -- Place code to be performed after a frame is created here. 14 | end 15 | 16 | -- show ######################################################################## 17 | function mod:Show(frame) 18 | -- Place code to be performed after a frame is shown here. 19 | end 20 | 21 | -- hide ######################################################################## 22 | function mod:Hide(frame) 23 | -- Place code to be performed after a frame is hidden here. 24 | end 25 | 26 | -- initialise ################################################################## 27 | function mod:Initialise() 28 | self:RegisterMessage('Create') 29 | self:RegisterMessage('Show') 30 | self:RegisterMessage('Hide') 31 | end 32 | -------------------------------------------------------------------------------- /custom.two-health-values.lua: -------------------------------------------------------------------------------- 1 | local folder,ns=... 2 | local addon = KuiNameplates 3 | local core = KuiNameplatesCore 4 | local kui = LibStub('Kui-1.0') 5 | 6 | local mod = addon:NewPlugin('TwoHealthValues',101,5) 7 | if not mod then return end 8 | 9 | -- replace level text instead of modifying health text? 10 | local REPLACE_LEVEL_TEXT = false 11 | -- show percent symbol? (only when REPLACE_LEVEL_TEXT is false) 12 | local PERCENT_SYMBOL = false 13 | 14 | -- ############################################################################# 15 | local function ReplaceLevelText(f) 16 | f:leveltohealth_UpdateHealthText() 17 | 18 | if REPLACE_LEVEL_TEXT then 19 | if f.state.health_cur == f.state.health_max then 20 | f.LevelText:SetText() 21 | else 22 | f.LevelText:SetText(kui.num(f.state.health_cur)) 23 | end 24 | else 25 | local p = f.state.health_per 26 | p = p < 1 and string.format('%.1f',p) or ceil(p) 27 | 28 | -- override with current + percent 29 | f.HealthText:SetText(kui.num(f.state.health_cur)..' | '..p..(PERCENT_SYMBOL and '%' or '')) 30 | end 31 | end 32 | 33 | function mod:Create(f) 34 | f.leveltohealth_UpdateHealthText = f.UpdateHealthText 35 | f.UpdateHealthText = ReplaceLevelText 36 | end 37 | function mod:UNIT_LEVEL(event,f) 38 | f:UpdateHealthText() 39 | end 40 | 41 | function mod:Initialise() 42 | self:RegisterMessage('Create') 43 | 44 | if REPLACE_LEVEL_TEXT then 45 | self:RegisterUnitEvent('UNIT_LEVEL') 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /old/custom.fliptext.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- Kui_Nameplates 3 | -- By Kesava at curse.com 4 | -- 5 | -- Moves health text to the left and level text to the right and makes health 6 | -- text a bit larger. Conflicts with leftie. 7 | ]] 8 | local kn = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') 9 | local mod = kn:NewModule('CustomInjector', 'AceEvent-3.0') 10 | 11 | -- change these to your desired settings 12 | local HEALTH_X_OFFSET = 2.5 13 | local HEALTH_Y_OFFSET = 0 14 | local HEALTH_FONT_SIZE = 14 15 | 16 | ------------------------------------------------------------------------ Show -- 17 | function mod:PostShow(msg, f) 18 | -- Place code to be performed after a frame is shown here 19 | f.health.p:ClearAllPoints() 20 | f.health.p:SetPoint('TOPLEFT', f.health, 'BOTTOMLEFT', 21 | HEALTH_X_OFFSET, kn.db.profile.text.healthoffset + HEALTH_Y_OFFSET) 22 | 23 | if f.health.mo then 24 | f.health.mo:ClearAllPoints() 25 | f.health.mo:SetPoint('BOTTOMLEFT', f.health.p, 'BOTTOMRIGHT', 0, 0) 26 | end 27 | 28 | if f.level and f.level.enabled then 29 | f.level:ClearAllPoints() 30 | f.level:SetPoint('TOPRIGHT', f.health, 'BOTTOMRIGHT', 31 | -2.5, kn.db.profile.text.healthoffset + 4) 32 | end 33 | 34 | -- change health font size 35 | local health_font = { f.health.p:GetFont() } 36 | health_font[2] = HEALTH_FONT_SIZE 37 | 38 | f.health.p:SetFont(unpack(health_font)) 39 | end 40 | -------------------------------------------------------------------- Register -- 41 | mod:RegisterMessage('KuiNameplates_PostShow', 'PostShow') 42 | -------------------------------------------------------------------------------- /custom.hide-friends-in-instances.lua: -------------------------------------------------------------------------------- 1 | -- automagically disable friendly nameplates upon entering an instance 2 | -- 3 | -- problems include and are probably not limited to: 4 | -- * gets confused if you set the combat toggle dropdowns to anything other 5 | -- than "do nothing" 6 | -- * gets confused if another addon or bossmods toggles friendly nameplates 7 | -- (for whatever reason that might be) 8 | local folder,ns=... 9 | local addon = KuiNameplates 10 | local core = KuiNameplatesCore 11 | 12 | local mod = addon:NewPlugin('HideFriendlyInInstances',101,5) 13 | if not mod then return end 14 | 15 | function mod:PLAYER_ENTERING_WORLD() 16 | local was_in_instance = KuiNameplatesCoreCharacterSaved.HideFriendlyInInstances_hidden 17 | local in_instance,instance_type = IsInInstance() 18 | if in_instance and ( 19 | instance_type == 'party' or 20 | instance_type == 'raid' or 21 | instance_type == 'scenario') 22 | then 23 | -- in instance; 24 | if not was_in_instance and 25 | not GetCVarBool('nameplateShowFriends') 26 | then 27 | -- don't do anything if they're already disabled 28 | return 29 | end 30 | 31 | SetCVar('nameplateShowFriends',false) 32 | KuiNameplatesCoreCharacterSaved.HideFriendlyInInstances_hidden = true 33 | elseif was_in_instance then 34 | -- out of instance; unhide 35 | SetCVar('nameplateShowFriends',true) 36 | KuiNameplatesCoreCharacterSaved.HideFriendlyInInstances_hidden = nil 37 | end 38 | end 39 | function mod:Initialise() 40 | self:RegisterEvent('PLAYER_ENTERING_WORLD') 41 | end 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Kui_Nameplates_Customs 2 | ====================== 3 | Templates and scripts to modify KNP's behaviour, generally made for specific people, for testing ideas, or if I'm just too lazy to put something in KNP by default. 4 | 5 | KNP's updates might cause these to spew errors at you. You need to manually update them; bookmark this page! 6 | 7 | How do I use this? 8 | ------------------ 9 | 10 | 1. Download [Kui_Nameplates_Custom.zip](https://github.com/kesava-wow/kuinameplates-customs/raw/master/Kui_Nameplates_Custom.zip) and install it like any other addon. 11 | - By extracting the `Kui_Nameplates_Custom` folder into `World of Warcraft/_retail_/Interface/AddOns` 12 | 2. Click one of the custom.\*.lua files in the list above ("Save as" will NOT work for this link) 13 | - If you end up on a [page like this](https://github.com/kesava-wow/kuinameplates-customs/raw/master/virus-example.png), you can just save the page (CTRL+S). 14 | - If you end up on a GitHub webpage, [find this button](https://github.com/kesava-wow/kuinameplates-customs/raw/master/this-is-the-raw-link.png), right click it, and hit "Save as..." (or whatever equivalent there is in your browser). 15 | 3. Save the file within the `Kui_Nameplates_Custom` folder you just extracted 16 | 4. Rename the file to custom.lua (overwriting the old file if necessary) 17 | 5. Launch the game and make sure Kui_Nameplates_Custom shows in the addon list and is enabled 18 | 19 | To use more than one at a time: 20 | --- 21 | 22 | 1. Download the lua file you want into the `Interface/AddOns/Kui_Nameplates_Custom` folder you already created. 23 | 2. Open the `Kui_Nameplates_Custom.toc` file with a plaintext editor (like notepad). 24 | 3. Add the name of the new lua file to the end of the toc file, on its own line, after the `custom.lua` line. 25 | 4. Relaunch WoW. 26 | 27 | -------------------------------------------------------------------------------- /old/deficit-health.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Kui_Nameplates/create.lua b/Kui_Nameplates/create.lua 2 | index f8a5482..c44841c 100644 3 | --- a/Kui_Nameplates/create.lua 4 | +++ b/Kui_Nameplates/create.lua 5 | @@ -93,6 +93,12 @@ function addon:CreateHealthBar(frame, f) 6 | 7 | f.health:GetStatusBarTexture():SetDrawLayer('ARTWORK',-8) 8 | 9 | + f.health.bg = CreateFrame('StatusBar',nil,f) 10 | + f.health.bg:SetStatusBarTexture(addon.bartexture) 11 | + f.health.bg:SetAllPoints(f.health) 12 | + 13 | + f.health:SetFrameLevel(f.health.bg:GetFrameLevel()+1) 14 | + 15 | if self.SetValueSmooth then 16 | -- smooth bar 17 | f.health.OrigSetValue = f.health.SetValue 18 | diff --git a/Kui_Nameplates/layout.lua b/Kui_Nameplates/layout.lua 19 | index f04bf83..d442d00 100644 20 | --- a/Kui_Nameplates/layout.lua 21 | +++ b/Kui_Nameplates/layout.lua 22 | @@ -70,7 +70,8 @@ local function SetHealthColour(self,sticky,r,g,b) 23 | if not self.healthColourPriority or 24 | sticky >= self.healthColourPriority 25 | then 26 | - self.health:SetStatusBarColor(r,g,b) 27 | + self.health.bg:SetStatusBarColor(r, g, b) 28 | + self.health:SetStatusBarColor(0,0,0,.7) 29 | self.healthColourPriority = sticky 30 | end 31 | return 32 | @@ -115,7 +116,8 @@ local function SetHealthColour(self,sticky,r,g,b) 33 | self.player = true 34 | end 35 | 36 | - self.health:SetStatusBarColor(r, g, b) 37 | + self.health.bg:SetStatusBarColor(r, g, b) 38 | + self.health:SetStatusBarColor(0,0,0,.7) 39 | end 40 | end 41 | 42 | diff --git a/Kui_Nameplates/modules/nameonly.lua b/Kui_Nameplates/modules/nameonly.lua 43 | index 62a4f1e..8fbd047 100644 44 | --- a/Kui_Nameplates/modules/nameonly.lua 45 | +++ b/Kui_Nameplates/modules/nameonly.lua 46 | @@ -69,6 +69,7 @@ local function SwitchOn(f) 47 | f.incWarning:SetParent(f) 48 | end 49 | 50 | + f.health.bg:Hide() 51 | f.health:Hide() 52 | f.overlay:Hide() 53 | f.bg:Hide() 54 | @@ -91,6 +92,7 @@ local function SwitchOff(f) 55 | }) 56 | f.name:SetParent(f.overlay) 57 | 58 | + f.health.bg:Show() 59 | f.health:Show() 60 | f.overlay:Show() 61 | f.bg:Show() 62 | -------------------------------------------------------------------------------- /custom.health-text-mods.lua: -------------------------------------------------------------------------------- 1 | local folder,ns=... 2 | local addon = KuiNameplates 3 | local core = KuiNameplatesCore 4 | local kui = LibStub('Kui-1.0') 5 | 6 | local mod = addon:NewPlugin('HealthTextMods',101,3) 7 | if not mod then return end 8 | 9 | -- (percent) show a percent symbol 10 | local PERCENT_SYMBOL = true 11 | -- (percent) percentage of health under which decimals should be displayed 12 | local DECIMAL_THRESHOLD = 1 13 | -- (percent) decimal places to show when below DECIMAL_THRESHOLD 14 | local DECIMAL_PLACES = 1 15 | 16 | -- ############################################################################# 17 | local function UpdateHealthText(f,...) 18 | f:healthtextmods_UpdatehealthText(...) 19 | if not f.HealthText:IsShown() or f.HealthText:GetText() == '' then return end 20 | 21 | -- determine what key is currently displayed 22 | -- (1=cur,2=max,3=per,4=deficit,5=blank) 23 | local key 24 | if f.state.friend then 25 | if f.state.health_cur ~= f.state.health_max then 26 | key = core.profile.health_text_friend_dmg 27 | else 28 | key = core.profile.health_text_friend_max 29 | end 30 | elseif f.state.health_cur ~= f.state.health_max then 31 | key = core.profile.health_text_hostile_dmg 32 | else 33 | key = core.profile.health_text_hostile_max 34 | end 35 | 36 | -- modify display 37 | if key == 3 then 38 | local v = f.state.health_per 39 | if DECIMAL_THRESHOLD and DECIMAL_PLACES and 40 | v < DECIMAL_THRESHOLD and DECIMAL_PLACES > 0 41 | then 42 | v = string.format('%.'..DECIMAL_PLACES..'f',f.state.health_per) 43 | else 44 | v = ceil(f.state.health_per) 45 | end 46 | 47 | if PERCENT_SYMBOL then 48 | v = v..'%' 49 | end 50 | 51 | f.HealthText:SetText(v) 52 | end 53 | end 54 | 55 | function mod:Create(f) 56 | f.healthtextmods_UpdatehealthText = f.UpdateHealthText 57 | f.UpdateHealthText = UpdateHealthText 58 | end 59 | function mod:Initialise() 60 | PERCENT_SYMBOL = PERCENT_SYMBOL and true or false 61 | DECIMAL_THRESHOLD = tonumber(DECIMAL_THRESHOLD) 62 | DECIMAL_PLACES = tonumber(DECIMAL_PLACES) 63 | 64 | self:RegisterMessage('Create') 65 | end 66 | -------------------------------------------------------------------------------- /custom.target-target-glow.lua: -------------------------------------------------------------------------------- 1 | -- makes the target's target's nameplate glow pink 2 | -- eg. a healer targeting a tank can see which nameplate the tank is targeting 3 | local folder,ns=... 4 | local addon = KuiNameplates 5 | local core = KuiNameplatesCore 6 | local mod = addon:NewPlugin('TargetTargetGlow',101,5) 7 | if not mod then return end 8 | local previous_frame 9 | -- local functions ############################################################# 10 | local function UpdateTargetTargetGlow() 11 | local tt = C_NamePlate.GetNamePlateForUnit('targettarget') 12 | if previous_frame and previous_frame ~= tt then 13 | if previous_frame.kui.unit then 14 | previous_frame.kui:UpdateFrameGlow() 15 | end 16 | previous_frame = nil 17 | end 18 | if tt and tt.kui and tt.kui.unit then 19 | previous_frame = tt 20 | tt.kui:UpdateFrameGlow() 21 | end 22 | end 23 | local function Frame_UpdateFrameGlow(frame) 24 | frame:TargetTargetHighlight_UpdateFrameGlow() 25 | 26 | if not frame.state.target and 27 | not frame.state.highlight and 28 | not frame.state.glowing and 29 | UnitIsUnit(frame.unit,'targettarget') 30 | then 31 | if frame.IN_NAMEONLY then 32 | frame.NameOnlyGlow:SetVertexColor(153,0,255) 33 | frame.NameOnlyGlow:SetAlpha(.8) 34 | frame.NameOnlyGlow:Show() 35 | else 36 | frame.ThreatGlow:SetVertexColor(153,0,255) 37 | frame.ThreatGlow:SetAlpha(.8) 38 | end 39 | end 40 | end 41 | -- events ###################################################################### 42 | function mod:UNIT_TARGET(event,unit) 43 | if unit ~= 'target' and unit ~= 'player' then return end 44 | UpdateTargetTargetGlow() 45 | end 46 | -- messages #################################################################### 47 | function mod:Create(frame) 48 | frame.TargetTargetHighlight_UpdateFrameGlow = frame.UpdateFrameGlow 49 | frame.UpdateFrameGlow = Frame_UpdateFrameGlow 50 | end 51 | function mod:TargetUpdate(frame) 52 | UpdateTargetTargetGlow() 53 | end 54 | -- initialise ################################################################## 55 | function mod:OnEnable() 56 | if core.CREATE2 then return end 57 | self:RegisterEvent('UNIT_TARGET') 58 | self:RegisterMessage('Create') 59 | self:RegisterMessage('GainedTarget','TargetUpdate') 60 | self:RegisterMessage('LostTarget','TargetUpdate') 61 | end 62 | -------------------------------------------------------------------------------- /custom.leftie.lua: -------------------------------------------------------------------------------- 1 | local addon = KuiNameplates 2 | local core = KuiNameplatesCore 3 | 4 | local mod = addon:NewPlugin('Leftie',104,5) 5 | if not mod then return end 6 | 7 | -- local functions ############################################################# 8 | local function UpdateNameTextPosition(f,...) 9 | f.leftie_UpdateNameTextPosition(f,...) 10 | 11 | if f.IN_NAMEONLY then return end 12 | 13 | f.NameText:ClearAllPoints() 14 | f.NameText:SetJustifyH('LEFT') 15 | f.NameText:SetPoint('BOTTOMLEFT',f.HealthBar,'TOPLEFT',2.5,core.profile.name_vertical_offset) 16 | 17 | if f.HealthText:IsShown() then 18 | f.NameText:SetPoint('RIGHT',f.HealthText,'LEFT') 19 | else 20 | f.NameText:SetPoint('RIGHT',f.HealthBar,2.5,0) 21 | end 22 | end 23 | local function UpdateHealthText(f,...) 24 | f.leftie_UpdateHealthText(f,...) 25 | 26 | if not f.HealthText:IsShown() then return end 27 | if f.state.no_name then return end 28 | 29 | f.HealthText:ClearAllPoints() 30 | f.HealthText:SetJustifyH('RIGHT') 31 | f.HealthText:SetPoint('BOTTOMRIGHT',f.HealthBar,'TOPRIGHT',-2.5,core.profile.name_vertical_offset) 32 | end 33 | local function UpdateSpellNamePosition(f,...) 34 | f.leftie_UpdateSpellNamePosition(f,...) 35 | 36 | f.SpellName:ClearAllPoints() 37 | f.SpellName:SetJustifyH('LEFT') 38 | f.SpellName:SetPoint( 39 | 'TOPLEFT',f.CastBar,'BOTTOMLEFT', 40 | 2.5, core.profile.castbar_name_vertical_offset 41 | ) 42 | end 43 | -- messages #################################################################### 44 | function mod:Create(f) 45 | if f.NameText and not f.leftie_UpdateNameTextPosition then 46 | f.leftie_UpdateNameTextPosition = f.UpdateNameTextPosition 47 | f.UpdateNameTextPosition = UpdateNameTextPosition 48 | f:UpdateNameTextPosition() 49 | end 50 | if f.HealthText and not f.leftie_UpdateHealthText then 51 | f.leftie_UpdateHealthText = f.UpdateHealthText 52 | f.UpdateHealthText = UpdateHealthText 53 | f:UpdateHealthText() 54 | end 55 | if f.SpellName and not f.leftie_UpdateSpellNamePosition then 56 | f.leftie_UpdateSpellNamePosition = f.UpdateSpellNamePosition 57 | f.UpdateSpellNamePosition = UpdateSpellNamePosition 58 | f:UpdateSpellNamePosition() 59 | end 60 | end 61 | -- register #################################################################### 62 | function mod:OnEnable() 63 | self:RegisterMessage('Create') 64 | end 65 | -------------------------------------------------------------------------------- /custom.simple-aura-mods.lua: -------------------------------------------------------------------------------- 1 | -- README 2 | -- 3 | -- By default, this enables OmniCC-like addons on aura buttons. There are 4 | -- rendering issues with aura cooldown frames, which is why it's not included 5 | -- in KNP. 6 | -- 7 | -- configuration ############################################################### 8 | 9 | local ADD_COOLDOWN_SPIRAL = true -- add a cooldown spiral to icons 10 | local HIDE_CD_TEXT = true -- hide KNP's CD text 11 | 12 | -- delete or comment out any of the above lines (like this - notice the two 13 | -- dashes at the start) to disable the modification. 14 | 15 | -- below lines should be left alone ############################################ 16 | local folder,ns=... 17 | local addon = KuiNameplates 18 | local core = KuiNameplatesCore 19 | 20 | local mod = addon:NewPlugin('SimpleAuraMods',101,5) 21 | if not mod then return end 22 | 23 | local button_UpdateCooldown 24 | local function button_UpdateCooldown(self,duration,expiration) 25 | if HIDE_CD_TEXT then 26 | self.cd:Hide() 27 | else 28 | button_old_UpdateCooldown(self,duration,expiration) 29 | end 30 | 31 | if ADD_COOLDOWN_SPIRAL then 32 | -- update cooldown spiral 33 | if duration and expiration then 34 | self.sam_cdf:SetCooldown(expiration-duration,duration) 35 | self.sam_cdf:Show() 36 | else 37 | self.sam_cdf:SetCooldown(0,0) 38 | self.sam_cdf:Hide() 39 | end 40 | end 41 | end 42 | 43 | local function PostCreateAuraButton(frame,button) 44 | if ADD_COOLDOWN_SPIRAL then 45 | -- name for OmniCC rule matching: 46 | -- KuiNameplate%d+AuraButton%d+CDF 47 | local cdf = CreateFrame('Cooldown', 48 | button.parent.parent:GetName()..'AuraButton'..(#button.parent.buttons+1)..'CDF', 49 | button,'CooldownFrameTemplate') 50 | cdf:SetDrawBling(false) 51 | cdf:SetReverse(true) 52 | cdf:SetAllPoints(button) 53 | button.sam_cdf = cdf 54 | 55 | if not HIDE_CD_TEXT then 56 | cdf:SetHideCountdownNumbers(true) 57 | cdf.noCooldownCount = true 58 | end 59 | 60 | button.cd:SetParent(cdf) 61 | 62 | button_old_UpdateCooldown = button.UpdateCooldown 63 | button.UpdateCooldown = button_UpdateCooldown 64 | end 65 | end 66 | 67 | function mod:Initialise() 68 | self:AddCallback('Auras','PostCreateAuraButton',PostCreateAuraButton) 69 | end 70 | -------------------------------------------------------------------------------- /old/custom.lowhealthcolours.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- Kui_Nameplates 3 | -- By Kesava at curse.com 4 | -- 5 | -- changes colour of health bars based on health percentage 6 | ]] 7 | local addon = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') 8 | local mod = addon:NewModule('LowHealthColours', 'AceEvent-3.0') 9 | 10 | mod.uiName = 'Low health colour' 11 | 12 | local LOW_HEALTH_COLOR, PRIORITY 13 | 14 | local function OnHealthValueChanged(oldHealth,current) 15 | local frame = oldHealth:GetParent():GetParent().kui 16 | local percent = frame.health.percent 17 | 18 | if percent <= 20 then 19 | frame:SetHealthColour(PRIORITY, unpack(LOW_HEALTH_COLOR)) 20 | frame.stuckLowHealth = true 21 | elseif frame.stuckLowHealth then 22 | frame:SetHealthColour(false) 23 | frame.stuckLowHealth = nil 24 | end 25 | end 26 | 27 | function mod:PostCreate(msg, frame) 28 | frame.oldHealth:HookScript('OnValueChanged',OnHealthValueChanged) 29 | end 30 | 31 | mod.configChangedFuncs = { runOnce = {} } 32 | mod.configChangedFuncs.runOnce.colour = function(v) 33 | LOW_HEALTH_COLOR = v 34 | end 35 | mod.configChangedFuncs.runOnce.priority = function(v) 36 | PRIORITY = v and 15 or 5 37 | end 38 | 39 | function mod:GetOptions() 40 | return { 41 | enabled = { 42 | name = 'Colour health bars at low health', 43 | desc = 'Change the colour of low health units\' health bars', 44 | type = 'toggle', 45 | width = 'double', 46 | order = 10 47 | }, 48 | priority = { 49 | name = 'Override tank mode', 50 | desc = 'When using tank mode, allow the low health colour to override tank mode colouring', 51 | type = 'toggle', 52 | order = 20 53 | }, 54 | colour = { 55 | name = 'Low health colour', 56 | desc = 'The colour to use', 57 | type = 'color', 58 | order = 30 59 | } 60 | } 61 | end 62 | 63 | function mod:OnInitialize() 64 | self.db = addon.db:RegisterNamespace(self.moduleName, { 65 | profile = { 66 | enabled = true, 67 | priority = false, 68 | colour = { 1, 1, .85 } 69 | } 70 | }) 71 | 72 | addon:InitModuleOptions(self) 73 | 74 | LOW_HEALTH_COLOR = self.db.profile.colour 75 | PRIORITY = self.db.profile.priority and 15 or 5 76 | 77 | self:SetEnabledState(self.db.profile.enabled) 78 | end 79 | 80 | function mod:OnEnable() 81 | self:RegisterMessage('KuiNameplates_PostCreate', 'PostCreate') 82 | end 83 | function mod:OnDisable() 84 | self:UnregisterMessage('KuiNameplates_PostCreate', 'PostCreate') 85 | end 86 | 87 | -------------------------------------------------------------------------------- /custom.explosives.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- adds a crosshair to explosives in M+ 3 | -- 4 | -- (zhTW translation needed) 5 | -- 6 | local addon = KuiNameplates 7 | local mod = addon:NewPlugin('Custom_Explosives',101,5) 8 | if not mod then return end 9 | 10 | local mob_name 11 | local function icon_Show(self) 12 | self.v:Show() 13 | self.h:Show() 14 | self.i:Show() 15 | end 16 | local function icon_Hide(self) 17 | self.v:Hide() 18 | self.h:Hide() 19 | self.i:Hide() 20 | end 21 | function mod:Create(f) 22 | f.feicon = {} 23 | 24 | local v = f:CreateTexture(nil,'ARTWORK',nil,1) 25 | v:SetTexture('interface/buttons/white8x8') 26 | v:SetVertexColor(1,0,0,.5) 27 | v:SetHeight(30000) 28 | v:SetWidth(3) 29 | f.feicon.v = v 30 | 31 | local h = f:CreateTexture(nil,'ARTWORK',nil,1) 32 | h:SetTexture('interface/buttons/white8x8') 33 | h:SetVertexColor(1,0,0,.5) 34 | h:SetHeight(3) 35 | h:SetWidth(30000) 36 | f.feicon.h = h 37 | 38 | local i = f:CreateTexture(nil,'ARTWORK',nil,2) 39 | i:SetTexture(135799) 40 | i:SetVertexColor(1,1,1,1) 41 | i:SetHeight(50) 42 | i:SetWidth(50) 43 | f.feicon.i = i 44 | 45 | i:SetPoint('BOTTOM',f,'TOP') 46 | v:SetPoint('CENTER',i) 47 | h:SetPoint('CENTER',i) 48 | 49 | f.feicon.Show = icon_Show 50 | f.feicon.Hide = icon_Hide 51 | f.feicon:Hide() 52 | end 53 | function mod:Show(f) 54 | if f.state.name ~= mob_name then return end 55 | if not f.feicon then 56 | self:Create(f) 57 | end 58 | f.feicon:Show() 59 | end 60 | function mod:Hide(f) 61 | if f.feicon then 62 | f.feicon:Hide() 63 | end 64 | end 65 | function mod:PLAYER_ENTERING_WORLD() 66 | if IsInInstance() then 67 | local instance_type,difficulty = select(2,GetInstanceInfo()) 68 | if instance_type == 'party' then 69 | local show_mythic = select(6,GetDifficultyInfo(difficulty)) 70 | if show_mythic then 71 | self:RegisterMessage('Show') 72 | return 73 | end 74 | end 75 | end 76 | self:UnregisterMessage('Show') 77 | end 78 | function mod:Initialise() 79 | self:RegisterEvent('PLAYER_ENTERING_WORLD') 80 | self:RegisterEvent('UPDATE_INSTANCE_INFO','PLAYER_ENTERING_WORLD') 81 | self:RegisterMessage('Hide') 82 | 83 | local locale = GetLocale() 84 | local names = { 85 | deDE = 'Sprengstoff', 86 | enUS = 'Explosives', 87 | esMX = 'Explosivos', 88 | frFR = 'Explosifs', 89 | itIT = 'Esplosivi', 90 | ptBR = 'Explosivos', 91 | ruRU = 'Взрывчатка', 92 | koKR = '폭발물', 93 | zhCN = '爆炸物', 94 | } 95 | mob_name = (locale and names[locale]) or names.enUS 96 | end 97 | -------------------------------------------------------------------------------- /custom.target-name.lua: -------------------------------------------------------------------------------- 1 | -- add the unit's target's name above their name. 2 | -- Difficult to describe in a coherent sentence. 3 | local folder,ns=... 4 | local addon = KuiNameplates 5 | local core = KuiNameplatesCore 6 | local kui = LibStub('Kui-1.0') 7 | 8 | local mod = addon:NewPlugin('TargetName',101,5) 9 | if not mod then return end 10 | 11 | local UPDATE_INTERVAL = .25 12 | local update_frame = CreateFrame('Frame') 13 | local elapsed = 0 14 | 15 | -- local functions ############################################################# 16 | local function update_frame_OnUpdate(self,elap) 17 | -- units changing target doesn't fire an event, so we have to check constantly 18 | elapsed = elapsed + elap 19 | 20 | if elapsed >= UPDATE_INTERVAL then 21 | elapsed = 0 22 | 23 | for _,f in addon:Frames() do 24 | if f:IsShown() and f.unit then 25 | local guid = UnitGUID(f.unit..'target') 26 | if guid ~= f.state.target_guid then 27 | f.state.target_guid = guid 28 | addon:DispatchMessage('TargetChanged',f) 29 | end 30 | end 31 | end 32 | end 33 | end 34 | -- messages #################################################################### 35 | function mod:Create(frame) 36 | if frame.TargetName then return end 37 | 38 | local tn = frame:CreateFontString(nil,'OVERLAY') 39 | tn:SetPoint('CENTER',frame.NameText,'TOP',0,10) 40 | 41 | frame.TargetName = tn 42 | end 43 | function mod:TargetChanged(frame) 44 | if frame.state.personal then return end 45 | if frame.state.target_guid then 46 | if UnitIsUnit(frame.unit..'target','player') then 47 | frame.TargetName:SetText('You') 48 | frame.TargetName:SetTextColor(1,.1,.1) 49 | else 50 | frame.TargetName:SetText(UnitName(frame.unit..'target')) 51 | frame.TargetName:SetTextColor(kui.GetUnitColour(frame.unit..'target',2)) 52 | end 53 | frame.TargetName:Show() 54 | else 55 | frame.TargetName:Hide() 56 | end 57 | end 58 | function mod:Show(frame) 59 | local font,_,flags = frame.NameText:GetFont() 60 | frame.TargetName:SetFont(font,core.profile.font_size_small,flags) 61 | 62 | frame.state.target_guid = UnitGUID(frame.unit..'target') 63 | self:TargetChanged(frame) 64 | end 65 | function mod:Hide(frame) 66 | frame.TargetName:Hide() 67 | end 68 | -- initialise ################################################################## 69 | function mod:OnEnable() 70 | for _,f in addon:Frames() do 71 | self:Create(f) 72 | end 73 | 74 | update_frame:SetScript('OnUpdate',update_frame_OnUpdate) 75 | 76 | self:RegisterMessage('Create') 77 | self:RegisterMessage('TargetChanged') 78 | self:RegisterMessage('Show') 79 | self:RegisterMessage('Hide') 80 | end 81 | function mod:OnDisable() 82 | update_frame:SetScript('OnUpdate',nil) 83 | end 84 | -------------------------------------------------------------------------------- /Kui_Nameplates_OldTextures/custom.lua: -------------------------------------------------------------------------------- 1 | local folder,ns=... 2 | local addon = KuiNameplates 3 | local core = KuiNameplatesCore 4 | local mod = addon:NewPlugin('OldTextures',101,5) 5 | if not mod then return end 6 | -- configuration ############################################################### 7 | local OLD_TARGET_ARROWS = true 8 | local OLD_THREAT_BRACKETS = true 9 | local ARROWS_INSET = 3 10 | -- end configuration ########################################################### 11 | local TARGET_ARROW = 'interface/addons/kui_nameplates_oldtextures/target-arrow' 12 | local THREAT_BRACKET = 'interface/addons/kui_nameplates_oldtextures/threat-bracket' 13 | local TB_POINTS = { 14 | { 'BOTTOMLEFT', 'TOPLEFT', 0, 1.3 }, 15 | { 'BOTTOMRIGHT', 'TOPRIGHT', 0, 1.3 }, 16 | { 'TOPLEFT', 'BOTTOMLEFT', 0, -1.5 }, 17 | { 'TOPRIGHT', 'BOTTOMRIGHT', 0, -1.5 }, 18 | } 19 | -- local functions ############################################################# 20 | local function ThreatBrackets_SetSize(self,size) 21 | for k,v in ipairs(self.textures) do 22 | v:SetSize(size*2,size) 23 | 24 | local p = TB_POINTS[k] 25 | local x_offset = floor((size * 2) * .28125) - 1 26 | if k % 2 == 1 then 27 | x_offset = -x_offset 28 | end 29 | v:SetPoint(p[1],v:GetParent().bg,p[2],x_offset,p[4]) 30 | end 31 | end 32 | local function Arrows_UpdatePosition(self) 33 | local inset = ARROWS_INSET + (self.l:GetHeight() * .12) 34 | self.l:SetPoint('RIGHT',self.parent.bg,'LEFT',inset,-1) 35 | self.r:SetPoint('LEFT',self.parent.bg,'RIGHT',-inset,-1) 36 | end 37 | -- show ######################################################################## 38 | function mod:Show(frame) 39 | if OLD_TARGET_ARROWS and frame.TargetArrows then 40 | if not frame.TargetArrows._old_textures then 41 | frame.TargetArrows.l:SetBlendMode('BLEND') 42 | frame.TargetArrows.l:SetTexture(TARGET_ARROW) 43 | frame.TargetArrows.l:SetTexCoord(0,.72,0,1) 44 | 45 | frame.TargetArrows.r:SetBlendMode('BLEND') 46 | frame.TargetArrows.r:SetTexture(TARGET_ARROW) 47 | frame.TargetArrows.r:SetTexCoord(.72,0,0,1) 48 | 49 | frame.TargetArrows.UpdatePosition = Arrows_UpdatePosition 50 | frame.TargetArrows._old_textures = true 51 | end 52 | 53 | frame.TargetArrows.l:SetWidth(frame.TargetArrows.l:GetHeight()*.72) 54 | frame.TargetArrows.r:SetWidth(frame.TargetArrows.r:GetHeight()*.72) 55 | end 56 | if OLD_THREAT_BRACKETS and frame.ThreatBrackets then 57 | if not frame.ThreatBrackets._old_textures then 58 | for i,texture in ipairs(frame.ThreatBrackets.textures) do 59 | texture:SetBlendMode('BLEND') 60 | texture:SetTexture(THREAT_BRACKET) 61 | texture:ClearAllPoints() 62 | end 63 | 64 | frame.ThreatBrackets.SetSize = ThreatBrackets_SetSize 65 | frame.ThreatBrackets._old_textures = true 66 | end 67 | end 68 | end 69 | -- initialise ################################################################## 70 | function mod:Initialise() 71 | self:RegisterMessage('Show') 72 | end 73 | -------------------------------------------------------------------------------- /old/custom.mindharvest.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | -- custom.lua for Kui_Nameplates 3 | -- By Kesava at curse.com 4 | -- mind harvest module test 5 | ]] 6 | local addon = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') 7 | local mod = addon:NewModule('CustomInjector', 'AceEvent-3.0') 8 | 9 | local MIND_HARVEST_GLYPH_ID = 1202 10 | local MIND_HARVEST_KNOWN 11 | 12 | local MIND_HARVEST_USED = {} 13 | local usedIndex = {} 14 | 15 | function mod:COMBAT_LOG_EVENT_UNFILTERED(event,...) 16 | local sourceGUID = select(4,...) 17 | if sourceGUID ~= UnitGUID('player') then return end 18 | 19 | local log_event = select(2,...) 20 | if log_event ~= 'SPELL_DAMAGE' then return end 21 | 22 | local spellID = select(12,...) 23 | if spellID ~= 8092 then return end 24 | 25 | local targetGUID = select(8,...) 26 | if not MIND_HARVEST_USED[targetGUID] then 27 | MIND_HARVEST_USED[targetGUID] = true 28 | tinsert(usedIndex, targetGUID) 29 | 30 | -- purge index over 100 31 | if #usedIndex > 100 then 32 | MIND_HARVEST_USED[tremove(usedIndex, 1)] = nil 33 | end 34 | 35 | local frame = addon:GetNameplate(targetGUID, nil) 36 | if frame then 37 | self:HideNotifier(nil, frame) 38 | end 39 | end 40 | end 41 | 42 | function mod:PLAYER_ENTERING_WORLD() 43 | self:ScanGlyphs() 44 | end 45 | function mod:GLYPH_ADDED() 46 | self:ScanGlyphs() 47 | end 48 | function mod:GLYPH_UPDATED() 49 | self:ScanGlyphs() 50 | end 51 | 52 | function mod:ScanGlyphs() 53 | for i=1,GetNumGlyphSockets() do 54 | local glyph_id = select(6,GetGlyphSocketInfo(i)) 55 | if glyph_id and glyph_id == MIND_HARVEST_GLYPH_ID then 56 | MIND_HARVEST_KNOWN = true 57 | return 58 | end 59 | end 60 | 61 | MIND_HARVEST_KNOWN = false 62 | end 63 | 64 | function mod:CreateNotifier(msg, frame) 65 | frame.mindharvest = frame.overlay:CreateTexture(nil, 'ARTWORK') 66 | local mh = frame.mindharvest 67 | mh:SetDrawLayer('ARTWORK',2) 68 | 69 | mh:SetTexture('Interface\\AddOns\\Kui_Nameplates\\media\\combopoint-round') 70 | mh:SetSize(9,9) 71 | mh:SetVertexColor(1,.4,1) 72 | mh:Hide() 73 | 74 | mh:SetPoint('LEFT', frame.overlay, 'RIGHT', 2, 0) 75 | end 76 | 77 | function mod:HideNotifier(msg, frame) 78 | frame.mindharvest:Hide() 79 | end 80 | 81 | function mod:GUIDStored(msg, f) 82 | if f.friend then return end 83 | if MIND_HARVEST_KNOWN and not MIND_HARVEST_USED[f.guid] then 84 | f.mindharvest:Show() 85 | end 86 | end 87 | 88 | function mod:OnInitialize() 89 | if select(2,UnitClass('player')) == 'PRIEST' then 90 | self:RegisterMessage('KuiNameplates_PostCreate', 'CreateNotifier') 91 | self:RegisterMessage('KuiNameplates_PostHide', 'HideNotifier') 92 | self:RegisterMessage('KuiNameplates_GUIDStored', 'GUIDStored') 93 | self:RegisterMessage('KuiNameplates_GUIDAssumed', 'GUIDStored') 94 | 95 | self:RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED') 96 | self:RegisterEvent('PLAYER_ENTERING_WORLD') 97 | self:RegisterEvent('GLYPH_ADDED') 98 | self:RegisterEvent('GLYPH_UPDATED') 99 | end 100 | end 101 | 102 | -------------------------------------------------------------------------------- /custom.mythicplus.lua: -------------------------------------------------------------------------------- 1 | -- some icons which are important for mythic+ 2 | -- (they should show up on the top right of nameplates) 3 | local addon = KuiNameplates 4 | local mod = addon:NewPlugin('Custom_MythicAuras',101,5) 5 | if not mod then return end 6 | local HAS_ENABLED 7 | 8 | local function GetBolsterCount(unit) 9 | local c = 0 10 | for i=1,40 do 11 | local name = UnitAura(unit,i) 12 | if name and name == 'Bolster' then -- XXX locale 13 | c = c+1 14 | end 15 | end 16 | return c 17 | end 18 | local function PostDisplayAuraButton(auraframe,button) 19 | if auraframe.id ~= 'Custom_Bolster' then return end 20 | button.count:SetText(GetBolsterCount(auraframe.parent.unit)) 21 | button.count:Show() 22 | end 23 | local function EnableAll() 24 | for _,f in addon:Frames() do 25 | if not f.MythicAuras then 26 | mod:Create(f) 27 | else 28 | f.MythicAuras:Enable() 29 | f.MythicBolster:Enable() 30 | end 31 | end 32 | mod:RegisterMessage('Create') 33 | HAS_ENABLED=true 34 | end 35 | local function DisableAll() 36 | for _,f in addon:Frames() do 37 | if f.MythicAuras then 38 | f.MythicAuras:Disable() 39 | f.MythicBolster:Disable() 40 | end 41 | end 42 | mod:UnregisterMessage('Create') 43 | end 44 | 45 | function mod:Create(f) 46 | assert(not f.MythicAuras) 47 | 48 | local mythic = f.handler:CreateAuraFrame({ 49 | max = 2, 50 | size = 32, 51 | squareness = 1, 52 | timer_threshold = 10, 53 | pulsate = false, 54 | y_spacing = 1, 55 | point = {'BOTTOMLEFT','LEFT','RIGHT'}, 56 | rows = 2, 57 | filter = 'HELPFUL', 58 | whitelist = { 59 | [226510] = true, -- Mythic Plus Affix: Sanguine 60 | [277242] = true, -- BfA Season 1: Symbiote of G'huun 61 | [260805] = true, -- Waycrest Manor: Focusing Iris 62 | [264027] = true, -- Waycrest Manor: Warding Candles 63 | [263246] = true, -- Temple of Sethralis: Lightning Shield 64 | [257597] = true, -- MOTHERLODE: Azerite Infusion 65 | }, 66 | }) 67 | mythic:SetFrameLevel(0) 68 | mythic:SetWidth(32) 69 | mythic:SetHeight(32) 70 | mythic:SetPoint('BOTTOMRIGHT',f,'TOPRIGHT',0,10) 71 | f.MythicAuras = mythic 72 | 73 | -- also create a frame to track stacks of bolstering... 74 | -- (XXX oops legacy auras - would this still work?) 75 | local bolster = f.handler:CreateAuraFrame({ 76 | id = 'Custom_Bolster', 77 | max = 1, 78 | size = 24, 79 | squareness = 1, 80 | timer_threshold = 10, 81 | pulsate = false, 82 | point = {'BOTTOMRIGHT','RIGHT','LEFT'}, 83 | rows = 1, 84 | filter = 'HELPFUL', 85 | whitelist = { [209859] = true } 86 | }) 87 | bolster:SetFrameLevel(0) 88 | bolster:SetWidth(24) 89 | bolster:SetHeight(24) 90 | bolster:SetPoint('BOTTOMLEFT',mythic,'BOTTOMRIGHT',1,0) 91 | f.MythicBolster = bolster 92 | end 93 | function mod:PLAYER_ENTERING_WORLD() 94 | if IsInInstance() then 95 | local instance_type,difficulty = select(2,GetInstanceInfo()) 96 | if instance_type == 'party' then 97 | local show_mythic = select(6,GetDifficultyInfo(difficulty)) 98 | if show_mythic then 99 | EnableAll() 100 | return 101 | end 102 | end 103 | end 104 | if HAS_ENABLED then 105 | DisableAll() 106 | end 107 | end 108 | function mod:Initialise() 109 | self:RegisterEvent('PLAYER_ENTERING_WORLD') 110 | self:RegisterEvent('UPDATE_INSTANCE_INFO','PLAYER_ENTERING_WORLD') 111 | self:AddCallback('Auras','PostDisplayAuraButton',PostDisplayAuraButton) 112 | end 113 | -------------------------------------------------------------------------------- /custom.name-and-target-colour.lua: -------------------------------------------------------------------------------- 1 | -- change colour of nameplate healthbars depending on their name or auras, 2 | -- or if they're your current target. 3 | local addon = KuiNameplates 4 | local kui = LibStub('Kui-1.0') 5 | local mod = addon:NewPlugin('ColourBarByName',101,5) 6 | if not mod then return end 7 | Mixin(mod,kui.FrameLockMixin) 8 | local plugin_fading,COLOUR_TARGET 9 | 10 | -- table of names -> bar colours (r,g,b) 11 | local names = { 12 | ['Elite Queensguard'] = {1,0,0}, 13 | ['Explosives'] = {1,0,1}, 14 | } 15 | -- should frames stay at max alpha when they match one of the above names? 16 | local FADE_IN_WITH_NAME = true 17 | 18 | -- table of spell ids -> bar colours 19 | local buffs = { 20 | [17] = {.6,1,.6}, 21 | } 22 | local debuffs = { 23 | [6788] = {1,.6,.6}, 24 | } 25 | -- should frames stay at max alpha when they have one of the above auras? 26 | local FADE_IN_WITH_AURA = true 27 | 28 | -- un-comment the next line to enable target colour (by removing the dashes) 29 | --COLOUR_TARGET = {.4,.8,.4} 30 | 31 | -- To overwrite tank mode, change 3 to 6 32 | -- To overwrite execute, change 3 to 5 33 | local PRIORITY = 3 34 | 35 | -- local functions ############################################################# 36 | -- reimplemented locally in execute & tankmode 37 | local function CanOverwriteHealthColor(f) 38 | return not f.state.health_colour_priority or 39 | f.state.health_colour_priority <= PRIORITY 40 | end 41 | local function FindAura(unit,func,tbl) 42 | for i=1,40 do 43 | local spellid = select(10,func(unit,i)) 44 | if not spellid then return end 45 | if tbl[spellid] then return tbl[spellid] end 46 | end 47 | end 48 | local function ResetBarColour(frame) 49 | if CanOverwriteHealthColor(frame) then 50 | frame.state.health_colour_priority = nil 51 | frame.HealthBar:SetStatusBarColor(unpack(frame.state.healthColour)) 52 | end 53 | end 54 | local function SetBarColour(frame,colour) 55 | frame.state.health_colour_priority = PRIORITY 56 | frame.HealthBar:SetStatusBarColor(unpack(colour)) 57 | end 58 | local function Fading_Update(frame) 59 | plugin_fading:UpdateFrame(frame) 60 | end 61 | -- ############################################################################# 62 | function mod.Fading_FadeRulesReset() 63 | if FADE_IN_WITH_NAME then 64 | plugin_fading:AddFadeRule(function(f) 65 | return f.state.ColourBarByName_Name and 1 66 | end,1) 67 | end 68 | if FADE_IN_WITH_AURA then 69 | plugin_fading:AddFadeRule(function(f) 70 | return f.state.ColourBarByName_Aura and 1 71 | end,1) 72 | end 73 | end 74 | function mod:NameUpdate(frame) 75 | if frame.state.ColourBarByName_Aura then return end 76 | if COLOUR_TARGET and frame.handler:IsTarget() then return end 77 | 78 | local col = frame.state.name and names[frame.state.name] 79 | local update_alpha 80 | if not col and frame.state.ColourBarByName_Name then 81 | update_alpha = true 82 | frame.state.ColourBarByName_Name = nil 83 | ResetBarColour(frame) 84 | elseif col and CanOverwriteHealthColor(frame) then 85 | update_alpha = not frame.state.ColourBarByName_Name 86 | frame.state.ColourBarByName_Name = true 87 | SetBarColour(frame,col) 88 | end 89 | if update_alpha then 90 | self:FrameLockFunc(Fading_Update,frame) 91 | end 92 | end 93 | -- messages #################################################################### 94 | function mod:Show(frame) 95 | self:UNIT_AURA(nil,frame) 96 | self:NameUpdate(frame) 97 | end 98 | function mod:GainedTarget(frame) 99 | if not COLOUR_TARGET then return end 100 | if CanOverwriteHealthColor(frame) then 101 | frame.state.ColourBarByName_Name = true 102 | SetBarColour(frame,COLOUR_TARGET) 103 | end 104 | end 105 | function mod:LostTarget(frame) 106 | if not COLOUR_TARGET then return end 107 | self:Show(frame) 108 | end 109 | -- events ###################################################################### 110 | function mod:UNIT_NAME_UPDATE(_,frame) 111 | self:NameUpdate(frame) 112 | end 113 | function mod:UNIT_AURA(_,frame) 114 | if COLOUR_TARGET and frame.handler:IsTarget() then return end 115 | local col = FindAura(frame.unit,UnitDebuff,debuffs) 116 | if not col then col = FindAura(frame.unit,UnitBuff,buffs) end 117 | 118 | local update_alpha 119 | if col and CanOverwriteHealthColor(frame) then 120 | update_alpha = not frame.state.ColourBarByName_Aura 121 | frame.state.ColourBarByName_Aura = true 122 | frame.state.ColourBarByName_Name = nil 123 | SetBarColour(frame,col) 124 | elseif frame.state.ColourBarByName_Aura then 125 | update_alpha = true 126 | frame.state.ColourBarByName_Aura = nil 127 | ResetBarColour(frame) 128 | self:NameUpdate(frame) 129 | end 130 | if update_alpha then 131 | self:FrameLockFunc(Fading_Update,frame) 132 | end 133 | end 134 | -- initialise ################################################################## 135 | function mod:Initialise() 136 | self:RegisterMessage('Show') 137 | self:RegisterMessage('HealthColourChange','Show') 138 | self:RegisterMessage('GainedTarget') 139 | self:RegisterMessage('LostTarget') 140 | self:RegisterUnitEvent('UNIT_NAME_UPDATE') 141 | self:RegisterUnitEvent('UNIT_AURA') 142 | 143 | plugin_fading = addon:GetPlugin('Fading') 144 | 145 | self:AddCallback('Fading','FadeRulesReset',self.Fading_FadeRulesReset) 146 | self.Fading_FadeRulesReset() 147 | end 148 | --------------------------------------------------------------------------------