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

Review Needed: A quick pass on sanity #52

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
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
18 changes: 9 additions & 9 deletions SmartBuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
-- Cast the most important buffs on you, tanks or party/raid members/pets.
-------------------------------------------------------------------------------

SMARTBUFF_DATE = "011124"; -- EU Date
-- Version/Release info, bump these as needed:
-- Bump .toc file and optionally update notes in localization.en.lua

SMARTBUFF_DATE = "011124"; -- EU Date
SMARTBUFF_VERSION = "r31." .. SMARTBUFF_DATE;
-- Update the NR below to force full reload of SB_Data on first login
-- Bump on major logic or buff changes only
SMARTBUFF_VERSIONNR = 110005;
-- End of version info

SMARTBUFF_TITLE = "SmartBuff";
SMARTBUFF_SUBTITLE = "Supports you in casting buffs";
SMARTBUFF_DESC = "Cast the most important buffs on you, your tanks, party/raid members/pets";
Expand All @@ -23,7 +28,6 @@ local SmartbuffPrefix = "Smartbuff";
local SmartbuffSession = true;
local SmartbuffVerCheck = false; -- for my use when checking guild users/testers versions :)
local buildInfo = select(4, GetBuildInfo())
local SmartbuffRevision = 30;
local SmartbuffVerNotifyList = {}

local SG = SMARTBUFF_GLOBALS;
Expand All @@ -32,9 +36,6 @@ local O = nil; -- Options local
local B = nil; -- Buff settings local
local _;

BINDING_HEADER_SMARTBUFF = "SmartBuff";
SMARTBUFF_BOOK_TYPE_SPELL = "spell";

local GlobalCd = 1.5;
local maxSkipCoolDown = 3;
local maxRaid = 40;
Expand Down Expand Up @@ -430,7 +431,7 @@ local function SendSmartbuffVersion(player, unit)
end
-- not announced, add the player and announce.
tinsert(SmartbuffVerNotifyList, { player, unit, GetTime() })
C_ChatInfo.SendAddonMessage(SmartbuffPrefix, SmartbuffRevision, "WHISPER", player)
C_ChatInfo.SendAddonMessage(SmartbuffPrefix, SMARTBUFF_VERSION, "WHISPER", player)
SMARTBUFF_AddMsgD(string.format("%s was sent version information.", player))
end

Expand Down Expand Up @@ -507,7 +508,7 @@ function SMARTBUFF_OnEvent(self, event, ...)

if ((event == "UNIT_NAME_UPDATE" and arg1 == "player") or event == "PLAYER_ENTERING_WORLD") then
if IsPlayerInGuild() and event == "PLAYER_ENTERING_WORLD" then
C_ChatInfo.SendAddonMessage(SmartbuffPrefix, SmartbuffRevision, "GUILD")
C_ChatInfo.SendAddonMessage(SmartbuffPrefix, SMARTBUFF_VERSION, "GUILD")
end
isPlayer = true;
if (event == "PLAYER_ENTERING_WORLD" and isInit and O.Toggle) then
Expand All @@ -531,8 +532,7 @@ function SMARTBUFF_OnEvent(self, event, ...)
if arg1 == SmartbuffPrefix then
-- its us.
if arg2 then
arg2 = tonumber(arg2)
if arg2 > SmartbuffRevision and SmartbuffSession then
if arg2 > SMARTBUFF_VERSION and SmartbuffSession then
DEFAULT_CHAT_FRAME:AddMessage(SMARTBUFF_MSG_NEWVER1 ..
SMARTBUFF_VERSION .. SMARTBUFF_MSG_NEWVER2 .. arg2 .. SMARTBUFF_MSG_NEWVER3)
SmartbuffSession = false
Expand Down