Skip to content

Commit e1e765e

Browse files
committed
0.4.1: LOS fix
1 parent f9d54cf commit e1e765e

6 files changed

Lines changed: 43 additions & 10 deletions

File tree

Buffalo/Buffalo-Classic.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Title: Buffalo - One-button buffing
22
## Notes: Smart addon to buff party / raid members
3-
## Version: 0.4.0
3+
## Version: 0.4.1
44
## Author: Mimma @ <EU-Pyrewood Village>
55
## Interface: 11403
66
## SavedVariables: Buffalo_Options

Buffalo/Buffalo.lua

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ local TimerTick = 0
5252
local NextScanTime = 0;
5353
local lastBuffTarget = "";
5454
local lastBuffStatus = "";
55+
local lastBuffFired = nil;
5556

5657
local Buffalo_GroupBuffProperties = { }; -- Array of buff properties for the group UI: { buffname, iconid, bitmask, priority }
5758
local Buffalo_SelfBuffProperties = { };
@@ -1259,19 +1260,15 @@ function Buffalo_UpdateBuffButton(unitid, spellname, textureId)
12591260
end;
12601261
end;
12611262

1263+
function Buffalo_OnBeforeBuffClick(self, ...)
1264+
lastBuffFired = BuffButton:GetAttribute("spell");
1265+
end;
1266+
12621267
function Buffalo_OnAfterBuffClick(self, ...)
12631268
local buttonName = ...;
12641269

12651270
if buttonName == "RightButton" then
12661271
Buffalo_OpenConfigurationDialogue();
1267-
else
1268-
if CONFIG_AnnounceCompletedBuff and not UnitAffectingCombat("player") then
1269-
local unitid = BuffButton:GetAttribute("unit");
1270-
local spellID = BuffButton:GetAttribute("spell");
1271-
if unitid and spellID then
1272-
Buffalo_Echo(string.format("%s was buffed with %s.", Buffalo_GetPlayerAndRealm(unitid) or "nil", GetSpellInfo(spellID)));
1273-
end;
1274-
end;
12751272
end;
12761273
end;
12771274

@@ -1740,6 +1737,34 @@ function Buffalo_OnEvent(self, event, ...)
17401737
elseif (event == "CHAT_MSG_ADDON") then
17411738
Buffalo_OnChatMsgAddon(event, ...)
17421739

1740+
elseif(event == "UNIT_SPELLCAST_STOP") then
1741+
local caster = ...;
1742+
if caster == "player" then
1743+
lastBuffFired = nil;
1744+
end;
1745+
1746+
elseif(event == "UNIT_SPELLCAST_FAILED") then
1747+
local caster = ...;
1748+
if caster == "player" then
1749+
lastBuffFired = nil;
1750+
end;
1751+
1752+
elseif(event == "UNIT_SPELLCAST_SUCCEEDED") then
1753+
local caster, _, spellId = ...;
1754+
1755+
if caster == "player" then
1756+
local buffName = GetSpellInfo(spellId);
1757+
if buffName and buffName == lastBuffFired then
1758+
lastBuffFired = nil;
1759+
if CONFIG_AnnounceCompletedBuff and not UnitAffectingCombat("player") then
1760+
local unitid = BuffButton:GetAttribute("unit");
1761+
if unitid then
1762+
Buffalo_Echo(string.format("%s was buffed with %s.", Buffalo_GetPlayerAndRealm(unitid) or "nil", buffName));
1763+
end;
1764+
end;
1765+
end;
1766+
end;
1767+
17431768
else
17441769
if(debug) then
17451770
echo("**DEBUG**: Other event: "..event);
@@ -1772,6 +1797,9 @@ function Buffalo_OnLoad()
17721797

17731798
BuffaloEventFrame:RegisterEvent("ADDON_LOADED");
17741799
BuffaloEventFrame:RegisterEvent("CHAT_MSG_ADDON");
1800+
BuffaloEventFrame:RegisterEvent("UNIT_SPELLCAST_STOP");
1801+
BuffaloEventFrame:RegisterEvent("UNIT_SPELLCAST_FAILED");
1802+
BuffaloEventFrame:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED");
17751803

17761804
BuffaloConfigFrame:SetBackdrop(BUFFALO_BACKDROP_FRAME);
17771805
BuffaloGeneralConfigFrame:SetBackdrop(BUFFALO_BACKDROP_FRAME);

Buffalo/Buffalo.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Title: Buffalo - One-button buffing
22
## Notes: Smart addon to buff party / raid members
3-
## Version: 0.4.0
3+
## Version: 0.4.1
44
## Author: Mimma @ <EU-Pyrewood Village>
55
## Interface: 20504
66
## SavedVariables: Buffalo_Options

Buffalo/Buffalo.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
self:RegisterForDrag("LeftButton");
2020
self:RegisterForClicks("LeftButtonUp", "RightButtonUp");
2121

22+
self:SetScript("PreClick", Buffalo_OnBeforeBuffClick);
2223
self:SetScript("PostClick", Buffalo_OnAfterBuffClick);
2324

2425
self:SetAttribute("*type1", "spell");

Buffalo/ReadMe.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ Priest PowerWordFortitude 53
7979

8080
Version history
8181
---------------
82+
Version 0.4.1
83+
* Bugfix: Failed buffs (out of LOS e.g.) are no longer announced in chat.
84+
85+
8286
Version 0.4.0
8387
* Bugfix: TBC Find Herbs / Find Minerals now working.
8488

Releases/Buffalo-0.4.1.zip

25.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)