Skip to content

Commit

Permalink
Merge pull request #27 from speedwaystar/main
Browse files Browse the repository at this point in the history
  • Loading branch information
Softrix authored May 12, 2023
2 parents 10a4cdd + e544d5f commit 5534601
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions SmartBuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2115,10 +2115,12 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
-- we have a buff, set the cvar - this will be reverted back
-- once smartbuff has finished its work. If we are in combat
-- lockdown then keep it at 0

if not InCombatLockdown() and O.SBButtonFix then
C_CVar.SetCVar("ActionButtonUseKeyDown",1 );
elseif O.SBButtonFix then
if (O.SBButtonDownVal == nil) then
O.SBButtonDownVal = C_CVar.GetCVarBool("ActionButtonUseKeyDown");
end
C_CVar.SetCVar("ActionButtonUseKeyDown", O.SBButtonDownVal );
end

Expand Down Expand Up @@ -2271,11 +2273,21 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
end
else
-- finished
if O.SBButtonFix then C_CVar.SetCVar("ActionButtonUseKeyDown", O.SBButtonDownVal ); end
if O.SBButtonFix then
if (O.SBButtonDownVal == nil) then
O.SBButtonDownVal = C_CVar.GetCVarBool("ActionButtonUseKeyDown");
end
C_CVar.SetCVar("ActionButtonUseKeyDown", O.SBButtonDownVal );
end
end
else
-- target does not need this buff
if O.SBButtonFix then C_CVar.SetCVar("ActionButtonUseKeyDown", O.SBButtonDownVal ); end
if O.SBButtonFix then
if (O.SBButtonDownVal == nil) then
O.SBButtonDownVal = C_CVar.GetCVarBool("ActionButtonUseKeyDown");
end
C_CVar.SetCVar("ActionButtonUseKeyDown", O.SBButtonDownVal );
end
end
else
-- cooldown
Expand Down Expand Up @@ -3473,8 +3485,13 @@ function SMARTBUFF_OToggleDebug()
end

function SMARTBUFF_ToggleFixBuffing()
O.SBButtonFix = not O.SBButtonFix;
if not O.SBButtonFix then C_CVar.SetCVar("ActionButtonUseKeyDown", O.SBButtonDownVal ); end
O.SBButtonFix = not O.SBButtonFix;
if (O.SBButtonDownVal == nil) then
O.SBButtonDownVal = C_CVar.GetCVarBool("ActionButtonUseKeyDown");
end
if not O.SBButtonFix then
C_CVar.SetCVar("ActionButtonUseKeyDown", O.SBButtonDownVal );
end
end

function SMARTBUFF_OptionsFrame_Toggle()
Expand Down

0 comments on commit 5534601

Please sign in to comment.