jobackman / SpellNotifications

A reupload of Veevs original SpellNotifications
2 stars 0 forks source link

Larger refactor of addon structure, by Oscarwika #5

Closed jobackman closed 3 years ago

jobackman commented 3 years ago

Big thanks to @oscarwika for this! https://github.com/oscarwika/SpellNotifications

Outside of @oscarwika contributions I made a few adjustments (no functional changes to addon users):

-- There could be a better name than `cast.by`, `cast.on` etc. 
-- I just wanted it to be readable as viewed down below
local cast = {}
function cast.by(affiliation)
    return bit.band(sourceFlags, affiliation) > 0
end
function cast.on(affiliation)
    return bit.band(destFlags, affiliation) > 0
end
function cast.notOn(affiliation)
    return bit.band(destFlags, affiliation) <= 0
end

Used as:

if event=="SPELL_INTERRUPT" and cast.by(ME) then
-- ...
end

-- ...

if ((
    event == "UNIT_DIED" or
    event == "UNIT_DESTROYED" or
    event == "UNIT_DESTROYED") and
    cast.on(ME) and
    cast.on(PET)
) then 

-- ...

if event=="SPELL_MISSED" and cast.notOn(ME) then
jobackman commented 3 years ago

Btw if you want a more direct contact, msg me or something, you can add my discord user ~~ in case I dont respond. Im probably more likely to to respond there cause Isuck at checking my email so I miss a lot of GH notifications πŸ˜†

jobackman commented 3 years ago

Perhaps merge my PR into this branch before commiting to master?

Definitely πŸ‘ I approved your PR when you I noticed that you pointed out it merges to this one πŸ˜‹

oscarwika commented 3 years ago

Btw if you want a more direct contact, msg me or something, you can add my discord user LucyON#1510 in case I dont respond. Im probably more likely to to respond there cause Isuck at checking my email so I miss a lot of GH notifications πŸ˜†

Hahah, yeah sure. My GitHub notifications are also filtered to another folder as well so yeah πŸ˜†

jobackman commented 3 years ago

Hahah, yeah sure. My GitHub notifications are also filtered to another folder as well so yeah πŸ˜†

image

😱

oscarwika commented 3 years ago

Hahah, yeah sure. My GitHub notifications are also filtered to another folder as well so yeah πŸ˜†

image

😱

Hahah shit, I don't have that many 🀣