Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WA v4.0.0. #101

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9b4fdbb
Update README.md
skylerh15 Sep 14, 2021
0b020b5
Repo was busted and i didnt know what to do
skyler-code Sep 14, 2021
8b6118a
AceGui to 4.3
skyler-code Sep 14, 2021
0e493da
SetPulloutWidth doesn't exist in 4.3 AceGui
skyler-code Sep 15, 2021
7c4ebe9
set AceSerializer and LibCompress to 4.3 versions
skyler-code Sep 18, 2021
a869709
Added missing frost dk talents
skyler-code Sep 30, 2021
5204da4
spacing cleanup
skyler-code Sep 30, 2021
3244b4d
use rank 1 of deepwounds
skyler-code Sep 30, 2021
3b5ea81
Load by specialization
skylerh15 Nov 1, 2021
c8f6d1a
specialization added to locales
skylerh15 Nov 2, 2021
2fc3f61
tab names are now dynamic
skylerh15 Nov 2, 2021
98022f6
no min_specs stuff
skylerh15 Nov 2, 2021
f031bd7
spec added to loadFunc
skylerh15 Nov 11, 2021
09ad739
redundant function
skylerh15 Nov 11, 2021
9ca93cf
Merge pull request #4 from Bunny67/master
skylerh15 Dec 7, 2021
eaa623b
bump toc version
skyler-code Dec 18, 2021
e5aa547
added faction reputation trigger
skyler-code Dec 20, 2021
4521731
can just loop to 1266
skyler-code Dec 20, 2021
0876ff8
Added assigned role to unit characteristics trigger
skyler-code Dec 20, 2021
5679b93
Added Spec role load option
skyler-code Dec 20, 2021
9c97857
role1 nil check
skyler-code Dec 20, 2021
2ed495d
one last nil fix
skyler-code Dec 21, 2021
6f4a7bb
Added UNIT_POWER_FREQUENT tracking
skyler-code Dec 21, 2021
91fb3bf
opened up some functions
skyler-code Dec 21, 2021
f6829a1
added another unit_power_frequent event
skyler-code Dec 21, 2021
a720bfb
Merge pull request #6 from Bunny67/master
skyler-code Jan 1, 2022
3a359b7
Added UNIT_SPELLCAST_SUCCEEDED event
skyler-code Jan 1, 2022
5827c0d
character stats tracking update
skyler-code Jan 1, 2022
d2710a7
Combat Log Event: Add "In Party" check, similar to "In Group"
skyler-code Jan 1, 2022
a382646
add assigned role to health and power
skyler-code Jan 1, 2022
d06f83c
added deficit to health and power triggers
skyler-code Jan 1, 2022
924e5b3
incoming heal to health
skyler-code Jan 1, 2022
54770d0
Added role to cast tracking
skyler-code Jan 1, 2022
c2a2fbc
ix Weapon Enchant Trigger name state value.
skyler-code Jan 1, 2022
d53c42b
Generic health trigger should fire UNIT_MAXHEALTH
skyler-code Jan 1, 2022
5e5f39f
removed overlays that exist in client
skyler-code Jan 1, 2022
89c8078
Revert "test desaturate"
skyler-code Jan 3, 2022
09f39cc
Merge branch 'Bunny67:master' into master
skyler-code Jan 3, 2022
de7f44f
BuffTrigger: Filter by Group Role
skyler-code Jan 5, 2022
f1ec397
localized role for text replacement
skyler-code Jan 5, 2022
3ef3a15
Revert "cleanup cd handlers"
skyler-code Jan 10, 2022
ed2dfb1
Restored "Exact Spell Match" option for spell triggers
skyler-code Jan 10, 2022
476be9c
added eclipse direction trigger
skyler-code Feb 14, 2022
e984193
added "item type equipped" load option and trigger
skyler-code Feb 19, 2022
fc8e944
added ranged slot enchant support
skyler-code Feb 22, 2022
da187db
IconAlert textures exist in 4.3 client
skyler-code Feb 22, 2022
275f28f
improved unit role tracking
skyler-code Feb 27, 2022
23e9806
remove debug print
skyler-code Feb 27, 2022
c57e569
GetRegion fix
skyler-code Jun 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -2356,13 +2356,13 @@ globals = {
"GetSpellAutocast",
"GetSpellBonusDamage",
"GetSpellBonusHealing",
"GetSpellBookItemName",
"GetSpellCooldown",
"GetSpellCount",
"GetSpellCritChance",
"GetSpellCritChanceFromIntellect",
"GetSpellInfo",
"GetSpellLink",
"GetSpellName",
"GetSpellNameColor",
"GetSpellPenetration",
"GetSpellTabInfo",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WeakAuras 2 WotLK (3.3.5a)
# WeakAuras 3 Cata (4.3.4)

WeakAuras is a powerful and flexible framework that allows the display of highly customizable graphics on World of Warcraft's user interface to indicate buffs, debuffs, and other relevant information. This addon was created to be a lightweight replacement for Power Auras but has since introduced more functionalities while remaining efficient and easy to use.

Expand Down
165 changes: 153 additions & 12 deletions WeakAuras/BuffTrigger2.lua

Large diffs are not rendered by default.

92 changes: 72 additions & 20 deletions WeakAuras/GenericTrigger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ do
WeakAuras.ScanEvents("SWING_TIMER_END");
end

local function swingTimerCLEUCheck(ts, event, sourceGUID, _, _, destGUID, _, _, ...)
local function swingTimerCLEUCheck(ts, event, _, sourceGUID, _, _, _, destGUID, _, _, _, ...)
Private.StartProfileSystem("generictrigger swing");
if(sourceGUID == selfGUID) then
if(event == "SWING_DAMAGE" or event == "SWING_MISSED") then
Expand Down Expand Up @@ -1808,6 +1808,9 @@ do

local spellCds = CreateSpellCDHandler();
local spellCdsRune = CreateSpellCDHandler();
local spellCdsOnlyCooldown = CreateSpellCDHandler();
local spellCdsOnlyCooldownRune = CreateSpellCDHandler();
local spellCdsCharges = CreateSpellCDHandler();

local spellIds = {}

Expand Down Expand Up @@ -1863,9 +1866,17 @@ do
end
end

function WeakAuras.GetSpellCooldown(id, ignoreRuneCD, showgcd)
function WeakAuras.GetSpellCooldown(id, ignoreRuneCD, showgcd, track)
local startTime, duration, gcdCooldown, readyTime
if (ignoreRuneCD) then
if track == "charges" then
startTime, duration, readyTime = spellCdsCharges:FetchSpellCooldown(id)
elseif track == "cooldown" then
if ignoreRuneCD then
startTime, duration, readyTime = spellCdsOnlyCooldownRune:FetchSpellCooldown(id)
else
startTime, duration, readyTime = spellCdsOnlyCooldown:FetchSpellCooldown(id)
end
elseif (ignoreRuneCD) then
startTime, duration, readyTime = spellCdsRune:FetchSpellCooldown(id)
else
startTime, duration, readyTime = spellCds:FetchSpellCooldown(id)
Expand Down Expand Up @@ -2025,17 +2036,18 @@ do
end

-- Default to GetSpellCharges
local cooldownBecauseRune = false;
local unifiedCooldownBecauseRune, cooldownBecauseRune = false, false;
if (enabled == 0) then
startTimeCooldown, durationCooldown = 0, 0
end

local onNonGCDCD = durationCooldown and startTimeCooldown and durationCooldown > 0 and (durationCooldown ~= gcdDuration or startTimeCooldown ~= gcdStart);
if (onNonGCDCD) then
cooldownBecauseRune = runeDuration and durationCooldown and abs(durationCooldown - runeDuration) < 0.001;
unifiedCooldownBecauseRune = cooldownBecauseRune
end

return startTimeCooldown, durationCooldown, cooldownBecauseRune, GetSpellCount(id);
return startTimeCooldown, durationCooldown, unifiedCooldownBecauseRune, cooldownBecauseRune, GetSpellCount(id);
end

function Private.CheckSpellKnown()
Expand All @@ -2051,7 +2063,7 @@ do
end

function Private.CheckSpellCooldown(id, runeDuration)
local startTimeCooldown, durationCooldown, cooldownBecauseRune, spellCount = WeakAuras.GetSpellCooldownUnified(id, runeDuration);
local startTimeCooldown, durationCooldown, unifiedCooldownBecauseRune, cooldownBecauseRune, spellCount = WeakAuras.GetSpellCooldownUnified(id, runeDuration);

local time = GetTime();
local remaining = startTimeCooldown + durationCooldown - time;
Expand All @@ -2067,10 +2079,14 @@ do
chargesChanged = true
end

local cdChanged, nowReady = spellCds:HandleSpell(id, startTimeCooldown, durationCooldown)
changed = spellCds:HandleSpell(id, startTimeCooldown, durationCooldown) or changed
if not unifiedCooldownBecauseRune then
changed = spellCdsRune:HandleSpell(id, startTimeCooldown, durationCooldown) or changed
end
local cdChanged, nowReady = spellCdsOnlyCooldown:HandleSpell(id, startTimeCooldown, durationCooldown)
changed = cdChanged or changed
if not cooldownBecauseRune then
changed = spellCdsRune:HandleSpell(id, startTimeCooldown, durationCooldown) or changed
changed = spellCdsOnlyCooldownRune:HandleSpell(id, startTimeCooldown, durationCooldown) or changed
end

if not WeakAuras.IsPaused() then
Expand Down Expand Up @@ -2276,12 +2292,16 @@ do
spellIds[id] = id
spellKnown[id] = WeakAuras.IsSpellKnownIncludingPet(id);

local startTimeCooldown, durationCooldown, cooldownBecauseRune, spellCount = WeakAuras.GetSpellCooldownUnified(id, GetRuneDuration());
local startTimeCooldown, durationCooldown, unifiedCooldownBecauseRune, cooldownBecauseRune, spellCount = WeakAuras.GetSpellCooldownUnified(id, GetRuneDuration());
spellCounts[id] = spellCount
spellCds:HandleSpell(id, startTimeCooldown, durationCooldown)
if not cooldownBecauseRune then
if not unifiedCooldownBecauseRune then
spellCdsRune:HandleSpell(id, startTimeCooldown, durationCooldown)
end
spellCdsOnlyCooldown:HandleSpell(id, startTimeCooldown, durationCooldown)
if not cooldownBecauseRune then
spellCdsOnlyCooldownRune:HandleSpell(id, startTimeCooldown, durationCooldown)
end
end

function WeakAuras.WatchItemCooldown(id)
Expand Down Expand Up @@ -2362,7 +2382,8 @@ function WeakAuras.WatchUnitChange(unit)
watchUnitChange:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT");
watchUnitChange:RegisterEvent("PARTY_MEMBERS_CHANGED");
watchUnitChange:RegisterEvent("RAID_ROSTER_UPDATE");
watchUnitChange:RegisterEvent("PLAYER_ENTERING_WORLD")
watchUnitChange:RegisterEvent("PLAYER_ENTERING_WORLD");
watchUnitChange:RegisterEvent("PLAYER_ROLES_ASSIGNED");

watchUnitChange:SetScript("OnEvent", function(self, event, unit)
Private.StartProfileSystem("generictrigger unit change");
Expand All @@ -2377,6 +2398,12 @@ function WeakAuras.WatchUnitChange(unit)
-- If in raid changed we send a UNIT_CHANGED for the group units
if inRaid ~= watchUnitChange.inRaid then
WeakAuras.ScanEvents("UNIT_CHANGED_" .. unit, unit)
else
local newRole = UnitGroupRolesAssigned(unit)
if watchUnitChange.unitRoles[unit] ~= newRole then
watchUnitChange.unitRoles[unit] = newRole
WeakAuras.ScanEvents("UNIT_ROLE_CHANGED_" .. unit, unit)
end
end
end
end
Expand Down Expand Up @@ -2406,11 +2433,11 @@ function WeakAuras.GetEquipmentSetInfo(itemSetName, partial)
if (name ~= nil) then
equipmentSetItemIDs = GetEquipmentSetItemIDs(name, equipmentSetItemIDs)
for slot, item in ipairs(equipmentSetItemIDs) do
if item > 0 then
if item > 1 then
numItems = numItems + 1
if equipmentItemIDs[slot] == item then
numEquipped = numEquipped + 1
end
if equipmentItemIDs[slot] == item then
numEquipped = numEquipped + 1
end
end
end
local match = (not partial and numItems == numEquipped)
Expand Down Expand Up @@ -2873,12 +2900,16 @@ end
do
local mh = GetInventorySlotInfo("MainHandSlot")
local oh = GetInventorySlotInfo("SecondaryHandSlot")
local th = GetInventorySlotInfo("RangedSlot")

local mh_name, mh_shortenedName, mh_exp, mh_dur, mh_charges;
local mh_icon = GetInventoryItemTexture("player", mh);
local mh_icon = GetInventoryItemTexture("player", mh) or "Interface\\Icons\\INV_Misc_QuestionMark"

local oh_name, oh_shortenedName, oh_exp, oh_dur, oh_charges;
local oh_icon = GetInventoryItemTexture("player", oh);
local oh_icon = GetInventoryItemTexture("player", oh) or "Interface\\Icons\\INV_Misc_QuestionMark"

local th_name, th_shortenedName, th_exp, th_dur, th_charges;
local th_icon = GetInventoryItemTexture("player", th) or "Interface\\Icons\\INV_Misc_QuestionMark"

local tenchFrame = nil
WeakAuras.frames["Temporary Enchant Handler"] = tenchFrame;
Expand Down Expand Up @@ -2911,11 +2942,12 @@ do

local function tenchUpdate()
Private.StartProfileSystem("generictrigger");
local _, mh_rem, oh_rem
_, mh_rem, mh_charges, _, oh_rem, oh_charges = GetWeaponEnchantInfo();
local mh_rem, oh_rem, th_rem
_, mh_rem, mh_charges, _, oh_rem, oh_charges, _, th_rem, th_charges = GetWeaponEnchantInfo();
local time = GetTime();
local mh_exp_new = mh_rem and (time + (mh_rem / 1000));
local oh_exp_new = oh_rem and (time + (oh_rem / 1000));
local th_exp_new = th_rem and (time + (th_rem / 1000));
if(math.abs((mh_exp or 0) - (mh_exp_new or 0)) > 1) then
mh_exp = mh_exp_new;
mh_dur = mh_rem and mh_rem / 1000;
Expand All @@ -2936,6 +2968,16 @@ do
end
oh_icon = GetInventoryItemTexture("player", oh)
end
if(math.abs((th_exp or 0) - (th_exp_new or 0)) > 1) then
th_exp = th_exp_new;
th_dur = th_rem and th_rem / 1000;
if th_exp then
th_name, th_shortenedName = getTenchName(th)
else
th_name, th_shortenedName = "None", "None"
end
th_icon = GetInventoryItemTexture("player", th)
end
WeakAuras.ScanEvents("TENCH_UPDATE");
Private.StopProfileSystem("generictrigger");
end
Expand All @@ -2959,6 +3001,16 @@ do
function WeakAuras.GetOHTenchInfo()
return oh_exp, oh_dur, oh_name, oh_shortenedName, oh_icon, oh_charges;
end

function WeakAuras.GetTHTenchInfo()
return th_exp, th_dur, th_name, th_shortenedName, th_icon, th_charges;
end
end

WeakAuras.GetItemSubClassInfo = function(i)
local subClassId = i % 256
local classId = (i - subClassId) / 256
return select(subClassId, GetAuctionItemSubClasses(classId))
end

-- Pets
Expand Down Expand Up @@ -3091,7 +3143,7 @@ do
local function findNewPlate(...)
for i = lastChildern + 1, numChildren do
local frame = select(i, ...)
local region, _, _, _, _, _, nameText = frame:GetRegions()
local region, _, _, nameText = frame:GetRegions()
if (frame.UnitFrame or (region and region:GetObjectType() == "Texture" and region:GetTexture() == OVERLAY)) and not nameplateList[frame] then
frame.nameText = nameText
frame:HookScript("OnShow", nameplateShow)
Expand Down
Loading