Skip to content

Commit

Permalink
r57 Release - auto hide action button / bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Softrix committed Oct 17, 2023
1 parent 8f36745 commit 19b2964
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 42 deletions.
7 changes: 6 additions & 1 deletion SmartBuff.buffs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ function SMARTBUFF_InitSpellIDs()
SMARTBUFF_DRUID_DIREBEAR = GetSpellInfo(9634); --"Dire Bear Form"
-- track humanoids
SMARTBUFF_DRUID_TRACK = GetSpellInfo(5225); --"Track Humanoids"
-- other
SMARTBUFF_OMENOFCLARITY = GetSpellInfo(16864) --"Omen of Clarity"

S.ChainDruidBuffs = { SMARTBUFF_MOTW, SMARTBUFF_GOTW };

Expand Down Expand Up @@ -898,8 +900,11 @@ function SMARTBUFF_InitSpellList()
{SSMARTBUFF_DRUID_BEAR, -1, SMARTBUFF_CONST_SELF},
{SMARTBUFF_DRUID_DIREBEAR, -1, SMARTBUFF_CONST_SELF},
-- tracking.
{SMARTBUFF_DRUID_TRACK, -1, SMARTBUFF_CONST_SELF, nil, SMARTBUFF_DRUID_CAT}
{SMARTBUFF_DRUID_TRACK, -1, SMARTBUFF_CONST_SELF, nil, SMARTBUFF_DRUID_CAT},
-- other
{SMARTBUFF_OMENOFCLARITY, 10, SMARTBUFF_CONST_SELF},
};

end

-- Priest
Expand Down
58 changes: 45 additions & 13 deletions SmartBuff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
-- Cast the most important buffs on you, tanks or party/raid members/pets.
-------------------------------------------------------------------------------

SMARTBUFF_DATE = "141023";
SMARTBUFF_DATE = "171023";

SMARTBUFF_VERSION = "r54."..SMARTBUFF_DATE;
SMARTBUFF_VERSION = "r57."..SMARTBUFF_DATE;
SMARTBUFF_VERSIONNR = 30403;
SMARTBUFF_VERWOTLK = false;
SMARTBUFF_TITLE = "SmartBuff";
Expand All @@ -26,7 +26,7 @@ local SmartbuffCommands = { "SBCVER", "SBCCMD", "SBCSYC" }
local SmartbuffSession = true;
local SmartbuffVerCheck = false; -- for my use when checking guild users/testers versions :)
local buildInfo = select(4, GetBuildInfo())
local SmartbuffRevision = 54;
local SmartbuffRevision = 57;
local SmartbuffVerNotifyList = {}

-- Using LibRangeCheck-2.0 by Mitchnull
Expand Down Expand Up @@ -136,7 +136,7 @@ local currentSpell = nil;
local currentTemplate = nil;
local currentSpec = nil;

local imgSB = "Interface\\Icons\\WoW_Token01";
local imgSB = "Interface\\Icons\\inv_gizmo_goblinboombox_01";
local imgIconOn = "Interface\\AddOns\\SmartBuff\\Icons\\MiniMapButtonEnabled";
local imgIconOff = "Interface\\AddOns\\SmartBuff\\Icons\\MiniMapButtonDisabled";

Expand Down Expand Up @@ -1383,7 +1383,14 @@ function SMARTBUFF_PreCheck(mode, force)
SMARTBUFF_ShowSAButton();
end

SMARTBUFF_SetButtonTexture(SmartBuff_KeyButton, imgSB);
-- if we have nothing to do and the option is set then just hide the action button.
if O.HideSAButtonNoAction and not InCombatLockdown() then
SmartBuff_KeyButton:Hide()
end

if not O.HideSAButtonNoAction and not O.HideSAButton then
SMARTBUFF_SetButtonTexture(SmartBuff_KeyButton, imgSB);
end
if (SmartBuffOptionsFrame:IsVisible()) then return false; end

-- check for mount-spells
Expand Down Expand Up @@ -1925,6 +1932,10 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
if (bUsable and cBuff.Params == SG.CheckPet and UnitExists("pet")) then bUsable = false end
if (bUsable and cBuff.Params == SG.CheckPetNeeded and not UnitExists("pet")) then bUsable = false end

if O.HideSAButtonNoAction and not O.HideSAButton and not InCombatLockdown() then
SmartBuff_KeyButton:Show();
end

-- Check for mount auras
if (bUsable and (sPlayerClass == "PALADIN" or sPlayerClass == "DEATHKNIGHT")) then
isMounted = false;
Expand Down Expand Up @@ -1967,14 +1978,18 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
elseif lookupData and isPlayerMoving then
bUsable = false;
end
else
if not isPlayerMoving then
else
-- is this food or water and im moving, if so just ignore it.
if (buffnS == SMARTBUFF_CONJFOOD or buffnS == SMARTBUFF_CONJWATER) and isPlayerMoving then
bUsable = false;
else
-- im not moving.
local lookupData
if (buffnS == SMARTBUFF_CONJFOOD) then
lookupData = ConjuredMageFood
lookupData = ConjuredMageFood
elseif (buffnS == SMARTBUFF_CONJWATER) then
lookupData = ConjuredMageWater
end
lookupData = ConjuredMageWater
end
if lookupData then
for count, value in next, lookupData do
if value then
Expand All @@ -1985,14 +2000,18 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
end
end
end
end
-- is it a mana gem while im moving?
if (buffnS == SMARTBUFF_CREATEMGEM_AGATE or buffnS == SMARTBUFF_CREATEMGEM_CITRINE or buffnS == SMARTBUFF_CREATEMGEM_JADE
or buffnS == SMARTBUFF_CREATEMGEM_RUBY) and isPlayerMoving then
bUsable = false;
else
if (buffnS == SMARTBUFF_CREATEMGEM_AGATE and SMARTBUFF_CheckBagItem(SMARTBUFF_MANAAGATE)) or
(buffnS == SMARTBUFF_CREATEMGEM_CITRINE and SMARTBUFF_CheckBagItem(SMARTBUFF_MANACITRINE)) or
(buffnS == SMARTBUFF_CREATEMGEM_JADE and SMARTBUFF_CheckBagItem(SMARTBUFF_MANAJADE)) or
(buffnS == SMARTBUFF_CREATEMGEM_RUBY and SMARTBUFF_CheckBagItem(SMARTBUFF_MANARUBY)) then
bUsable = false;
end
elseif (buffnS == SMARTBUFF_CONJFOOD or buffnS == SMARTBUFF_CONJWATER) and isPlayerMoving then
bUsable = false;
end
end
end
Expand Down Expand Up @@ -2521,6 +2540,9 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell)
end
end -- for buff
end
if O.HideSAButtonNoAction and not O.HideSAButton and not InCombatLockdown() then
SmartBuff_KeyButton:Hide();
end
isPrompting = false
return 3;
end
Expand Down Expand Up @@ -3216,6 +3238,7 @@ function SMARTBUFF_Options_Init(self)
if (O.ToggleMsgError == nil) then O.ToggleMsgError = false; end
if (O.HideMmButton == nil) then O.HideMmButton = false; end
if (O.HideSAButton == nil) then O.HideSAButton = true; end
if (O.HideSAButtonNoAction == nil) then O.HideSAButtonNoAction = true; end
-- tracking switcher, only works for herbs and minerals
if (O.TrackSwitchActive == nil) then O.TrackSwitchActive = false; end
if (O.TrackSwitchFish == nil) then O.TrackSwitchFish = false; end
Expand Down Expand Up @@ -3645,6 +3668,12 @@ function SMARTBUFF_OTrackDisableGrp()
cDisableTrackSwitch = false;
end
end
function SMARTBUFF_OHideSAButtonNoAction()
O.HideSAButtonNoAction = not O.HideSAButtonNoAction;
if not O.HideSAButtonNoAction and not O.HideSAButtonNoAction then
SMARTBUFF_ShowSAButton();
end
end

function SMARTBUFF_OToggleBuff(s, i)
local bs = GetBuffSettings(cBuffs[i].BuffS);
Expand Down Expand Up @@ -3967,6 +3996,7 @@ function SMARTBUFF_Options_OnShow()
SmartBuffOptionsFrame_cbMsgError:SetChecked(O.ToggleMsgError);
SmartBuffOptionsFrame_cbHideMmButton:SetChecked(O.HideMmButton);
SmartBuffOptionsFrame_cbHideSAButton:SetChecked(O.HideSAButton);
SmartBuffOptionsFrame_cbHideSAButtonNoAction:SetChecked(O.HideSAButtonNoAction);

SmartBuffOptionsFrame_cbGatherAutoSwitch:SetChecked(O.TrackSwitchActive);
SmartBuffOptionsFrame_cbGatherAutoSwitchFish:SetChecked(O.TrackSwitchFish);
Expand Down Expand Up @@ -4501,7 +4531,9 @@ function SMARTBUFF_OnPostClick(self, button, down)
self:SetAttribute("macrotext", nil);
self:SetAttribute("action", nil);

SMARTBUFF_SetButtonTexture(SmartBuff_KeyButton, imgSB);
if not O.HideSAButtonNoAction and not O.HideSAButton then
SMARTBUFF_SetButtonTexture(SmartBuff_KeyButton, imgSB);
end

-- ensure we reset the cvar back to the original players setting
-- if it was previously changed due to casting issues.
Expand Down
2 changes: 1 addition & 1 deletion SmartBuff.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 30403
## Title: |TInterface\Addons\Smartbuff\Icons\IconEnabled:0|t SmartBuff |cffffffff(WOTLK)|r
## Version: 54.30403
## Version: 57.30403
## Author: |cff20d2ffCodermik & Aeldra|r (EU-Proudmoore)
## Contributing Author: |cff20d2ffSpeedwaystar
## Notes: Automatically cast buffs on yourself, your party or raid members and their pets. Use /sbm for the options menu.
Expand Down
57 changes: 40 additions & 17 deletions SmartBuff.xml
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
</Button>
<Button name="SmartBuff_KeyButton" inherits="SecureActionButtonTemplate" hidden="true" parent="UIParent" toplevel="true" movable="true" frameStrata="LOW">
<Size>
<AbsDimension x="32" y="32" />
<AbsDimension x="25" y="25" />
</Size>
<Anchors>
<Anchor point="CENTER">
Expand Down Expand Up @@ -458,7 +458,7 @@
SMARTBUFF_SetButtonPos(self);
</OnDragStop>
</Scripts>
<NormalTexture file="Interface\ICONS\WoW_Token01" />
<NormalTexture file="Interface\Icons\inv_gizmo_goblinboombox_01" />
</Button>
<Frame name="SmartBuffOptionsFrame" hidden="true" parent="UIParent" toplevel="true" movable="true" frameStrata="DIALOG" enableMouse="true">
<Size>
Expand Down Expand Up @@ -875,9 +875,7 @@
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="SmartBuffOptionsFrame_cbAutoSwitchTmp" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="130" y="0" />
</Offset>
<Offset x="137" />
</Anchor>
</Anchors>
<HitRectInsets>
Expand Down Expand Up @@ -969,7 +967,7 @@
<Anchors>
<Anchor point="TOPLEFT" relativeTo="SmartBuffOptionsFrame_cbLinkGrpBuffCheck" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="130" y="0" />
<AbsDimension x="137" y="0" />
</Offset>
</Anchor>
</Anchors>
Expand Down Expand Up @@ -1030,9 +1028,7 @@
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="SmartBuffOptionsFrame_cbBuffPvP" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="130" y="0" />
</Offset>
<Offset x="137" />
</Anchor>
</Anchors>
<HitRectInsets>
Expand Down Expand Up @@ -1092,9 +1088,7 @@
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="SmartBuffOptionsFrame_cbScrollWheelUp" relativePoint="TOPLEFT">
<Offset>
<AbsDimension x="130" y="0" />
</Offset>
<Offset x="137" />
</Anchor>
</Anchors>
<HitRectInsets>
Expand Down Expand Up @@ -1152,7 +1146,7 @@
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="SmartBuffOptionsFrame_cbBuffInCities" relativePoint="TOPLEFT">
<Offset x="130" y="-20" />
<Offset x="137" y="-20" />
</Anchor>
</Anchors>
<HitRectInsets>
Expand Down Expand Up @@ -1533,11 +1527,11 @@
</Button>
<EditBox name="SmartBuffOptionsCredits_lblText" letters="2000" multiLine="true" autoFocus="false">
<Size>
<AbsDimension x="240" y="141" />
<AbsDimension x="240" y="129" />
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="$parent" relativePoint="TOPLEFT">
<Offset x="30" y="-563" />
<Offset x="30" y="-575" />
</Anchor>
</Anchors>
<FontString inherits="GameFontNormalTiny" justifyH="LEFT" />
Expand Down Expand Up @@ -1593,7 +1587,7 @@
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="SmartBuffOptionsFrame_cbBuffInCities" relativePoint="TOPLEFT">
<Offset x="130" />
<Offset x="137" />
</Anchor>
</Anchors>
<HitRectInsets>
Expand Down Expand Up @@ -1738,7 +1732,7 @@
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="SmartBuffOptionsFrame_cbScrollWheelUp" relativePoint="TOPLEFT">
<Offset x="190" />
<Offset x="197" />
</Anchor>
</Anchors>
<HitRectInsets>
Expand All @@ -1761,6 +1755,35 @@
</OnEnter>
</Scripts>
</CheckButton>
<CheckButton name="SmartBuffOptionsFrame_cbHideSAButtonNoAction" inherits="UICheckButtonTemplate">
<Size>
<AbsDimension x="20" y="20" />
</Size>
<Anchors>
<Anchor point="TOPLEFT" relativeTo="SmartBuffOptionsFrame_cbHideMmButton" relativePoint="TOPLEFT">
<Offset y="-31" />
</Anchor>
</Anchors>
<HitRectInsets>
<AbsInset left="0" right="0" top="0" bottom="0" />
</HitRectInsets>
<Scripts>
<OnEnter>
GameTooltip:SetOwner(self, "ANCHOR_RIGHT");
GameTooltip:SetText(SMARTBUFF_OFTT_HIDEABNOACTION, SMARTBUFF_TTC_R, SMARTBUFF_TTC_G, SMARTBUFF_TTC_B, SMARTBUFF_TTC_A);
</OnEnter>
<OnClick>
SMARTBUFF_OHideSAButtonNoAction();
</OnClick>
<OnLoad>
getglobal(self:GetName().."Text"):SetText(SMARTBUFF_OFT_HIDEABNOACTION);
getglobal(self:GetName().."Text"):SetFontObject(GameFontNormalSmall);
</OnLoad>
<OnLeave>
GameTooltip:Hide();
</OnLeave>
</Scripts>
</CheckButton>
</Frames>
<Scripts>
<OnLoad>
Expand Down
2 changes: 1 addition & 1 deletion SmartBuff_Vanilla.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 11404
## Title: |TInterface\Addons\Smartbuff\Icons\IconEnabled:0|t SmartBuff |cffffffff(ERA, HC)|r
## Version: 52.11404
## Version: 57.11404
## Author: |cff20d2ffCodermik & Aeldra|r (EU-Proudmoore)
## Contributing Author: |cff20d2ffSpeedwaystar
## Notes: Automatically cast buffs on yourself, your party or raid members and their pets. Use /sbm for the options menu.
Expand Down
4 changes: 4 additions & 0 deletions localization.cn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ BINDING_NAME_SMARTBUFF_BIND_RESETBUFFTIMERS = "重新设定BUFF定时器";

-- 设置窗口

-- show action button only when pending actions exist.
SMARTBUFF_OFT_HIDEABNOACTION = "仅在需要时显示";
SMARTBUFF_OFTT_HIDEABNOACTION = "当您自己、队伍成员、团队或宠物没有丢失增益时,隐藏操作按钮。 请注意,必须启用\n操作按钮才能使此选项发挥作用。";

-- experimental feature - for testing.
SMARTBUFF_OFT_FIXBUFF = "修复 铸造"
SMARTBUFF_OFTT_FIXBUFF = "如果施放 buff 失败,请勾选此选项。"
Expand Down
4 changes: 4 additions & 0 deletions localization.de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ SMARTBUFF_NOTINTENDEDCLIENT = "Diese Version von Smartbuff ist nicht für diese

-- Options Frame Text

-- show action button only when pending actions exist.
SMARTBUFF_OFT_HIDEABNOACTION = "Nur bei Bedarf anzeigen";
SMARTBUFF_OFTT_HIDEABNOACTION = "Blenden Sie die Aktionsschaltfläche aus, wenn keine Buffs für Sie selbst, Gruppenmitglieder, Raids oder Haustiere fehlen. Beachten Sie, dass die\nAktionsschaltfläche aktiviert sein muss, damit diese Option funktioniert.";

-- experimental feature - for testing.
SMARTBUFF_OFT_FIXBUFF = "Gießen reparieren"
SMARTBUFF_OFTT_FIXBUFF = "Ankreuzen, wenn Smartbuff keine Buffs wirkt."
Expand Down
16 changes: 7 additions & 9 deletions localization.en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@
SMARTBUFF_WHATSNEW = "\n\n"
.." |cff00e0ffClassic & Retail versions by Codermik with additional\n"
.." retail coding by Speedwaystar.\n\n"
.." |cffffffffChanges in r54.141023 (Classic):\n\n"
.." * Fixed Well Fed SpellId - Thanks EmmaLee \n\n"
.." * Reverted back 'Buff Target' setting to off.\n\n"
.." * Changed the default action button graphic\n"
.." that shows when no action is needed to a\n"
.." World of Warcraft logo.\n\n"
.." * Fixed bug under Classic ERA preventing buffs \n"
.." when running with your character. \n"
.." |cffffffffChanges in r57.171023 (Classic):\n\n"
.." * Fixed a LUA error caused while in combat.\n\n"
.."\n\n"
.." |cffffff00I currently play on the Mirage Raceway EU classic\n"
.." WOTLK server as Alliance, I play on Mik, Gabella,\n"
Expand Down Expand Up @@ -94,6 +88,10 @@ SMARTBUFF_OFTT_AUTOGATHOFF = "Automatically switch this feature OFF when in a p
SMARTBUFF_OFT_MOUNTEDWARN = "Prompt while mounted";
SMARTBUFF_OFTT_MOUNTEDWARN = "Continue to remind me of missing buffs or abilities while I am mounted and automatically dismount to buff.";

-- show action button only when pending actions exist.
SMARTBUFF_OFT_HIDEABNOACTION = "Show only when needed";
SMARTBUFF_OFTT_HIDEABNOACTION = "Hide the action button when there are no missing buffs\non yourself, party members, raid or pets. Note that the\nAction Button must be enabled for this option to work.";

SMARTBUFF_OFT = "SmartBuff On/Off";
SMARTBUFF_OFT_MENU = "Show/hide options menu";
SMARTBUFF_OFT_AUTO = "Reminder";
Expand Down Expand Up @@ -132,7 +130,7 @@ SMARTBUFF_OFT_RBT = "Reset BT";
SMARTBUFF_OFT_BUFFINCITIES = "Buff in cities";
SMARTBUFF_OFT_BLDURATION = "Blacklisted";
SMARTBUFF_OFT_ANTIDAZE = "Anti daze";
SMARTBUFF_OFT_HIDESABUTTON = "Hide action button";
SMARTBUFF_OFT_HIDESABUTTON = "Disable Action Button";
SMARTBUFF_OFT_INCOMBAT = "in combat";
SMARTBUFF_OFT_SMARTDEBUFF = "SmartDebuff";
SMARTBUFF_OFT_INSHAPESHIFT = "Shapeshift";
Expand Down
5 changes: 5 additions & 0 deletions localization.es.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ SMARTBUFF_NOTINTENDEDCLIENT = "Esta versi

-- Options Frame Text

-- show action button only when pending actions exist.
SMARTBUFF_OFT_HIDEABNOACTION = "Mostrar solo cuando sea necesario";
SMARTBUFF_OFTT_HIDEABNOACTION = "Oculta el botón de acción cuando no falten beneficios\n para ti, los miembros del grupo, la banda o las mascotas. Tenga en cuenta que el botón\nAcción debe estar habilitado para que esta opción funcione.";


-- experimental feature - for testing.
SMARTBUFF_OFT_FIXBUFF = "Corregir fundición"
SMARTBUFF_OFTT_FIXBUFF = "Marque si Smartbuff falla al lanzar beneficios."
Expand Down
Loading

0 comments on commit 19b2964

Please sign in to comment.