Skip to content

Commit

Permalink
Support for non-Dire Bear Form (level 10-39) #15
Browse files Browse the repository at this point in the history
HS and POT macro work for cat but not bear #17
  • Loading branch information
Jens N committed May 26, 2022
1 parent e33bd7a commit d12e98f
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions DruidMacroHelper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ local DRUID_MACRO_HELPER_LOC_STUN = { "STUN", "STUN_MECHANIC", "FEAR", "CHARM",
DruidMacroHelper = {};

function DruidMacroHelper:Init()
self.ChatThrottle = nil;
self.Frame = _G["DruidMacroHelperFrame"] or CreateFrame('Frame', 'DruidMacroHelperFrame');
self.Frame:SetScript("OnEvent", function(...)
self:OnEvent(...);
end);
self.SpellQueueWindow = 400;
self:RegisterEvent("PLAYER_ENTERING_WORLD");
self:RegisterItemShortcut("pot", 13446);
self:RegisterItemShortcut("potion", 13446);
self:RegisterItemShortcut("hs", 20520);
Expand Down Expand Up @@ -35,8 +42,6 @@ function DruidMacroHelper:Init()
self:CreateButton('dmhHs', self:GetMacroText('dmhHs'), 'Disable autoUnshift if not ready to use a healthstone');
self:CreateButton('dmhSap', self:GetMacroText('dmhSap'), 'Disable autoUnshift if not ready to use a sapper');
self:CreateButton('dmhSuperSap', self:GetMacroText('dmhSuperSap'), 'Disable autoUnshift if not ready to use a super sapper');
self.ChatThrottle = nil
self.SpellQueueWindow = 400
end

function DruidMacroHelper:LogOutput(...)
Expand Down Expand Up @@ -68,6 +73,16 @@ function DruidMacroHelper:ChatMessageThrottleUnit(message, unit)
end
end

function DruidMacroHelper:OnEvent(frame, event, ...)
if (event == "PLAYER_ENTERING_WORLD") then
self:UpdateForms();
elseif (event == "LEARNED_SPELL_IN_TAB") then
self:UpdateForms();
else
self:LogDebug("Unhandled Event:", event, ...);
end
end

function DruidMacroHelper:OnSlashCommand(parameters)
if not self.slashActions then
self:LogOutput("No slash actions registered!");
Expand Down Expand Up @@ -434,5 +449,9 @@ function DruidMacroHelper:RegisterSlashCommand(cmd)
end
end

function DruidMacroHelper:RegisterEvent(event)
self.Frame:RegisterEvent(event);
end

-- Kickstart the addon
DruidMacroHelper:Init();

0 comments on commit d12e98f

Please sign in to comment.