diff --git a/SmartBuff-Classic.toc b/SmartBuff-Classic.toc index 072cc29..48aabcc 100644 --- a/SmartBuff-Classic.toc +++ b/SmartBuff-Classic.toc @@ -1,6 +1,6 @@ ## Interface: 11403 ## Title: |TInterface\Addons\Smartbuff\Icons\IconEnabled:0|t SmartBuff |cffffffff(Classic Version)|r -## Version: 33.11403 +## Version: 34.11403 ## Author: |cff20d2ffCodermik (Mik / Castanova on EU-Mirage Raceway) & Aeldra|r (EU-Proudmoore) ## Notes: Cast the most important buffs on you or party, raid, pets and assigned tanks. Use /sbm for options menu. ## DefaultState: Enabled diff --git a/SmartBuff-Wrath.toc b/SmartBuff-TBC.toc similarity index 90% rename from SmartBuff-Wrath.toc rename to SmartBuff-TBC.toc index 37fb0ca..a1d762f 100644 --- a/SmartBuff-Wrath.toc +++ b/SmartBuff-TBC.toc @@ -1,6 +1,6 @@ -## Interface: 30400 -## Title: |TInterface\Addons\Smartbuff\Icons\IconEnabled:0|t SmartBuff |cffffffff(Classic Version)|r -## Version: 33.30400 +## Interface: 20504 +## Title: |TInterface\Addons\Smartbuff\Icons\IconEnabled:0|t SmartBuff |cffffffff(TBC Classic)|r +## Version: 34.20504 ## Author: |cff20d2ffCodermik (Mik / Castanova on EU-Mirage Raceway) & Aeldra|r (EU-Proudmoore) ## Notes: Cast the most important buffs on you or party, raid, pets and assigned tanks. Use /sbm for options menu. ## DefaultState: Enabled diff --git a/SmartBuff.lua b/SmartBuff.lua index 09b9387..34c0107 100644 --- a/SmartBuff.lua +++ b/SmartBuff.lua @@ -6,8 +6,8 @@ -- Cast the most important buffs on you, tanks or party/raid members/pets. ------------------------------------------------------------------------------- -SMARTBUFF_DATE = "160922"; -SMARTBUFF_VERSION = "r33."..SMARTBUFF_DATE; +SMARTBUFF_DATE = "190922"; +SMARTBUFF_VERSION = "r34."..SMARTBUFF_DATE; SMARTBUFF_VERSIONMIN = 11403; -- min version SMARTBUFF_VERSIONNR = 30400; -- max version SMARTBUFF_TITLE = "SmartBuff"; @@ -20,10 +20,10 @@ SMARTBUFF_OPTIONS_TITLE = SMARTBUFF_VERS_TITLE; local addonName = ... local SmartbuffPrefix = "Smartbuff"; local SmartbuffSession = true; -local SmartbuffVerCheck = false; -- for my use when checking guild users/testers versions :) +local SmartbuffVerCheck = false; -- for my use when checking guild users/testers versions :) local wowVersionString, wowBuild, _, wowTOC = GetBuildInfo(); -local isWOTLKC = (_G.WOW_PROJECT_ID == 5 and wowTOC >= 30000); -local SmartbuffRevision = 33; +local isWOTLKC = (_G.WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC and wowTOC >= 30400); +local SmartbuffRevision = 34; local SmartbuffVerNotifyList = {} -- Smartbuff now uses LibRangeCheck-2.0 by Mitchnull, not fully implemented @@ -158,6 +158,9 @@ local Icons = { ["NONE"] = { IconPaths.Roles, 20/64, 39/64, 22/64, 41/64 }, }; +-- available sounds (14) +local Sounds = { 1141, 3784, 4574, 17318, 15262, 13830, 15273, 10042, 10720, 17316, 3337, 7894, 7914, 10033 } + local DebugChatFrame = DEFAULT_CHAT_FRAME; -- upvalues @@ -207,6 +210,11 @@ local ORL = BCC(1, 0.6, 0.3); local WH = BCC(1, 1, 1); local CY = BCC(0.5, 1, 1); +-- function to preview selected warning sound in options screen +function SMARTBUFF_PlaySpashSound() + PlaySound(Sounds[O.AutoSoundSelection]); +end + -- Reorders values in the table local function treorder(t, i, n) if (t and type(t) == "table" and t[i]) then @@ -256,12 +264,21 @@ local function ChkS(text) return text; end +-- check for moonkin buff +local function CheckMoonkinBuff() + for i=1,40 do + name, rank, icon, count, debuffType, duration, expirationTime, unitCaster, isStealable, shouldConsolidate, spellId = UnitAura("player",i); + if name == SMARTBUFF_DRUID_MOONKIN then + return true; + end + end + return false; +end + local function IsFlying() + if (O.WarnWhileMounted) then return false; end local result = GetShapeshiftForm(false) - -- bugfix 6/7/2022, frost/shadow/sanct aura on paladin was causing the - -- GetShapeshiftForm to return 5 faking the addon into thinking the - -- player was actually flying on a druid. CM - if (result == 5 or result == 6) and sPlayerClass == "DRUID" then + if ((result == 5 and not CheckMoonkinBuff()) or result == 6) and sPlayerClass == "DRUID" then return true end return false @@ -294,12 +311,9 @@ local function UnitGroupRolesAssigned(unit) end local function IsVisibleToPlayer(self) - if (not self) then return false; end - + if (not self) then return false; end local w, h = UIParent:GetWidth(), UIParent:GetHeight(); - local x, y = self:GetLeft(), UIParent:GetHeight() - self:GetTop(); - - --print(format("w = %.0f, h = %.0f, x = %.0f, y = %.0f", w, h, x, y)); + local x, y = self:GetLeft(), UIParent:GetHeight() - self:GetTop(); if (x >= 0 and x < (w - self:GetWidth()) and y >= 0 and y < (h - self:GetHeight())) then return true; end @@ -310,7 +324,6 @@ local function CS() if isWOTLKC then currentSpec = GetActiveTalentGroup() or nil; else - -- still need to check currentSpec here. if (currentSpec == nil) then currentSpec = GetSpecialization() or nil; end @@ -443,11 +456,9 @@ local function IsPowerLimitOk(bs) -- if bs.ManaLimit <= 100 and powertype is mana then the ManaLimit is % if (bs.ManaLimit <= 100 and powerType == 0) then if (((UnitPower("player", powerType) / UnitPowerMax("player", powerType))) * 100 < bs.ManaLimit) then - --print(powerToken.." is below % threshold!"); return false; end elseif (UnitPower("player", powerType) < bs.ManaLimit) then - --print(powerToken.." is below threshold!"); return false; end end @@ -505,8 +516,8 @@ function SMARTBUFF_OnLoad(self) SLASH_SmartReloadUI1 = "/rui"; SMARTBUFF_InitSpellIDs(); - --DEFAULT_CHAT_FRAME:AddMessage("SB OnLoad"); end + -- END SMARTBUFF_OnLoad @@ -689,7 +700,6 @@ function SMARTBUFF_OnEvent(self, event, ...) if (string.find(arg1, "party") or string.find(arg1, "raid")) then spell = arg2; end - --SMARTBUFF_SetButtonTexture(SmartBuff_KeyButton, imgSB); end if (currentUnit and currentSpell and currentUnit ~= "target") then unit = currentUnit; @@ -700,9 +710,7 @@ function SMARTBUFF_OnEvent(self, event, ...) if (cBuffTimer[unit] == nil) then cBuffTimer[unit] = { }; end - --if (not SMARTBUFF_IsPlayer(unit)) then cBuffTimer[unit][spell] = GetTime(); - --end if (name ~= nil) then SMARTBUFF_AddMsg(name .. ": " .. spell .. " " .. SMARTBUFF_MSG_BUFFED); currentUnit = nil; @@ -768,7 +776,6 @@ function SMARTBUFF_Ticker(force) if (isAuraChanged) then isAuraChanged = false; - --SMARTBUFF_AddMsgD("Force check"); SMARTBUFF_Check(1, true); end @@ -870,7 +877,6 @@ function SMARTBUFF_SetUnits() SMARTBUFF_SetBuffs(); end SMARTBUFF_MiniGroup_Show(); - --SMARTBUFF_AddMsgD("Group type changed"); end wipe(cUnits); @@ -926,7 +932,6 @@ function SMARTBUFF_SetUnits() if (not b or B[CS()][currentTemplate].SelfFirst) then SMARTBUFF_AddSoloSetup(); iLastSubgroup = psg; - --SMARTBUFF_AddMsgD("Player not in selected groups or buff self first"); end if (iLastSubgroup ~= psg) then @@ -1043,8 +1048,8 @@ function SMARTBUFF_AddSoloSetup() cClassGroups[0][0] = "player"; end end --- END SMARTBUFF_SetUnits +-- END SMARTBUFF_SetUnits ------------------------------------------------------------------------------------------------------------------------------------- @@ -1071,7 +1076,6 @@ function SMARTBUFF_GetSpellID(spellname) i = i + 1; spellN = GetSpellBookItemName(i, BOOKTYPE_SPELL); skillType, spellId = GetSpellBookItemInfo(i, BOOKTYPE_SPELL); - --print(spellN.." "..spellId); if (skillType == "FLYOUT") then for j = 1, GetNumFlyouts() do @@ -1081,7 +1085,6 @@ function SMARTBUFF_GetSpellID(spellname) for s = 1, numSlots do local flySpellID, overrideSpellID, isKnown, spellN, slotSpecID = GetFlyoutSlotInfo(fid, s); if (isKnown and string.lower(spellN) == spellname) then - --print(spellname.." "..spellN.." "..flySpellID); return flySpellID; end end @@ -1192,7 +1195,6 @@ function SMARTBUFF_SetBuff(buff, i, ia) if (SMARTBUFF_IsSpell(cBuffs[i].Type) or cBuffs[i].Type == SMARTBUFF_CONST_TRACK) then cBuffs[i].IDS, cBuffs[i].BookID = SMARTBUFF_GetSpellID(cBuffs[i].BuffS); --- if cBuffs[i].IDS then print("Id: "..cBuffs[i].IDS.." BookId:"..cBuffs[i].BookID); end end if (cBuffs[i].IDS == nil and not(SMARTBUFF_IsItem(cBuffs[i].Type))) then @@ -1264,7 +1266,6 @@ function SMARTBUFF_SetInCombatBuffs() return; end for name, data in pairs(B[CS()][ct]) do - --SMARTBUFF_AddMsgD(name .. ", type = " .. type(data)); if (type(data) == "table" and cBuffIndex[name] and (B[CS()][ct][name].EnableS or B[CS()][ct][name].EnableG) and B[CS()][ct][name].CIn) then if (cBuffsCombat[name]) then wipe(cBuffsCombat[name]); @@ -1281,12 +1282,10 @@ function SMARTBUFF_SetInCombatBuffs() end -- END SMARTBUFF_SetBuffs - function SMARTBUFF_IsTalentFrameVisible() return PlayerTalentFrame and PlayerTalentFrame:IsVisible(); end - -- Main Check functions function SMARTBUFF_PreCheck(mode, force) if (not isInit) then return false end @@ -1316,15 +1315,14 @@ function SMARTBUFF_PreCheck(mode, force) if (SmartBuffOptionsFrame:IsVisible()) then return false; end -- check for mount-spells - if (sPlayerClass == "PALADIN" and (IsMounted() or IsFlying()) and not SMARTBUFF_CheckBuff("player", SMARTBUFF_CRUSADERAURA)) then + if (sPlayerClass == "PALADIN" and (IsMounted() or IsFlying()) and not O.WarnWhileMounted and not SMARTBUFF_CheckBuff("player", SMARTBUFF_CRUSADERAURA)) then return true; end - if ((mode == 1 and not O.ToggleAuto) or IsMounted() or IsFlying() or LootFrame:IsVisible() + if ((mode == 1 and not O.ToggleAuto) or not O.WarnWhileMounted and (IsMounted() or IsFlying() or LootFrame:IsVisible()) or UnitOnTaxi("player") or UnitIsDeadOrGhost("player") or UnitIsCorpse("player") or (mode ~= 1 and (SMARTBUFF_IsPicnic("player") or SMARTBUFF_IsFishing("player"))) or (UnitInVehicle("player") or UnitHasVehicleUI("player")) - --or (mode == 1 and (O.ToggleAutoRest and IsResting()) and not UnitIsPVP("player")) or (not O.BuffInCities and IsResting() and not UnitIsPVP("player"))) then if (UnitIsDeadOrGhost("player")) then @@ -1336,10 +1334,8 @@ function SMARTBUFF_PreCheck(mode, force) if (UnitAffectingCombat("player")) then isCombat = true; - --SMARTBUFF_AddMsgD("In combat"); else isCombat = false; - --SMARTBUFF_AddMsgD("Out of combat"); end if (not isCombat and isSetBuffs) then @@ -1353,7 +1349,6 @@ function SMARTBUFF_PreCheck(mode, force) return true; end - -- Bufftimer check functions function SMARTBUFF_CheckBuffTimers() local n = 0; @@ -1399,8 +1394,8 @@ function SMARTBUFF_CheckUnitBuffTimers(unit) end end end --- END SMARTBUFF_CheckUnitBuffTimers +-- END SMARTBUFF_CheckUnitBuffTimers -- Reset the buff timers and set them to running out soon function SMARTBUFF_ResetBuffTimers() @@ -1544,7 +1539,6 @@ function SMARTBUFF_ShowBuffTimers() end -- END SMARTBUFF_ResetBuffTimers - -- Synchronize the internal buff timers with the UI timers function SMARTBUFF_SyncBuffTimers() if (not isInit or isSync or isSetBuffs or SMARTBUFF_IsTalentFrameVisible()) then return; end @@ -1587,8 +1581,6 @@ function SMARTBUFF_SyncBuffTimers() if (buffS and B[CS()][ct][buffS].EnableS and cBuffs[i].IDS ~= nil and cBuffs[i].DurationS > 0) then if (cBuffs[i].Type ~= SMARTBUFF_CONST_SELF or (cBuffs[i].Type == SMARTBUFF_CONST_SELF and SMARTBUFF_IsPlayer(unit))) then - --and uc and B[CS()][ct][buffS][uc]) then - --SMARTBUFF_AddMsgD("Buff timer sync check: " .. buffS); SMARTBUFF_SyncBuffTimer(unit, unit, cBuffs[i], false); end end @@ -1698,7 +1690,6 @@ function SMARTBUFF_Check(mode, force) for spell in pairs(cBuffsCombat) do if (spell) then local ret, actionType, spellName, slot, unit, buffType = SMARTBUFF_BuffUnit("player", 0, mode, spell) - --SMARTBUFF_AddMsgD("Check combat spell: " .. spell .. ", ret = " .. ret); if (ret and ret == 0) then IsChecking = false; return; @@ -1726,10 +1717,9 @@ function SMARTBUFF_Check(mode, force) cGrp = cGroups; cOrd = cOrderGrp; - isMounted = IsMounted() or IsFlying(); + isMounted = (IsMounted() or IsFlying()) and not O.WarnWhileMounted; for _, subgroup in pairs(cOrd) do - --SMARTBUFF_AddMsgD("Checking subgroup " .. subgroup .. ", " .. GetTime()); if (cGrp[subgroup] ~= nil or (type(subgroup) == "number" and subgroup == 1)) then if (cGrp[subgroup] ~= nil) then @@ -1796,7 +1786,6 @@ function SMARTBUFF_Check(mode, force) -- clean up buff timer, if expired if (btl < 0) then cBuffTimer[subgroup][buffnG] = nil; - --SMARTBUFF_AddMsgD("Group " .. subgroup .. ": " .. buffnS .. " timer reset"); tLastCheck = GetTime() - SMARTBUFF_Options.AutoTimer + 0.5; return; end @@ -1815,17 +1804,11 @@ function SMARTBUFF_Check(mode, force) unitB = nil; for _, unit in pairs(unitsGrp) do j = j + 1; - SMARTBUFF_AddMsgD("Checking1 " .. buffnG .. " " .. unit); - - --if (unit and (UnitIsPlayer(unit) or (sPlayerClass == "PALADIN" and (UnitPlayerOrPetInParty(unit) or UnitPlayerOrPetInRaid(unit)))) and not SMARTBUFF_IsInList(unit, UnitName(unit), SMARTBUFF_Buffs[CS()][ct][buffnS].IgnoreList)) then + SMARTBUFF_AddMsgD("Checking1 " .. buffnG .. " " .. unit); if (unit and UnitIsPlayer(unit) and not SMARTBUFF_IsInList(unit, UnitName(unit), bs.IgnoreList)) then - SMARTBUFF_AddMsgD("Checking2 " .. buffnG .. " " .. unit); n = n + 1; - --if (UnitExists(unit) and not UnitIsDeadOrGhost(unit) and not UnitIsCorpse(unit) and UnitIsConnected(unit) and UnitIsVisible(unit) and not UnitOnTaxi(unit) and (SMARTBUFF_IsPlayer(unit) or not SMARTBUFF_Options.AdvGrpBuffRange or not SpellHasRange(cBuff.BuffG) or (IsSpellInRange(cBuff.BuffG, unit) == 1))) then - if (UnitExists(unit) and not UnitIsDeadOrGhost(unit) and not UnitIsCorpse(unit) and UnitIsConnected(unit) and UnitIsVisible(unit) and not UnitOnTaxi(unit) and UnitInRange(unit) == 1) then - --if (sPlayerClass ~= "PALADIN") tmpUnits[n] = unit; uLevel = UnitLevel(unit); if (uLevel < uLevelL) then @@ -2045,7 +2028,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) -- Check for mount auras isMounted = false; if (bUsable and sPlayerClass == "PALADIN") then - isMounted = IsMounted() or IsFlying(); + isMounted = (IsMounted() or IsFlying()) and not O.WarnWhileMounted; if ((buffnS ~= SMARTBUFF_CRUSADERAURA and isMounted) or (buffnS == SMARTBUFF_CRUSADERAURA and not isMounted)) then bUsable = false; end @@ -2190,7 +2173,6 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) else buff, index, buffname, bt, charges = SMARTBUFF_CheckUnitBuffs(unit, cBuff.Params, cBuff.Type, cBuff.Links, cBuff.Chain); end - --SMARTBUFF_AddMsgD("Buff time ("..cBuff.Params..") = "..tostring(bt)); else buff = nil; end @@ -2215,14 +2197,11 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) if (cBuff.Type == SMARTBUFF_CONST_ITEMGROUP or cBuff.Type == SMARTBUFF_CONST_SCROLL) then cds, cd = GetItemCooldown(iid); cd = (cds + cd) - time; - --SMARTBUFF_AddMsgD(cr.." "..buffnS.." found, cd = "..cd); if (cd > 0) then buff = nil; end end - --SMARTBUFF_AddMsgD(cr .. " " .. buffnS .. " found"); else - --SMARTBUFF_AddMsgD("No " .. buffnS .. " found"); buff = nil; bExpire = false; end @@ -2232,9 +2211,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) -- Weapon buff ------------------------------------------------------------------------ elseif (cBuff.Type == SMARTBUFF_CONST_WEAPON or cBuff.Type == SMARTBUFF_CONST_INV) then - --SMARTBUFF_AddMsgD("Check weapon Buff"); local bMh, tMh, cMh, idMh, bOh, tOh, cOh, idOh = GetWeaponEnchantInfo(); - if (bs.MH) then iSlot = 16; iId = GetInventoryItemID("player", iSlot); @@ -2258,7 +2235,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) buff = buffnS; end else - --SMARTBUFF_AddMsgD("Weapon Buff cannot be cast, no mainhand weapon equipped or wrong weapon/stone type"); + SMARTBUFF_AddMsgD("Weapon Buff cannot be cast, no mainhand weapon equipped or wrong weapon/stone type"); end end @@ -2285,7 +2262,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) buff = buffnS; end else - --SMARTBUFF_AddMsgD("Weapon Buff cannot be cast, no offhand weapon equipped or wrong weapon/stone type"); + SMARTBUFF_AddMsgD("Weapon Buff cannot be cast, no offhand weapon equipped or wrong weapon/stone type"); end end @@ -2302,8 +2279,7 @@ function SMARTBUFF_BuffUnit(unit, subgroup, mode, spell) -- Normal buff ------------------------------------------------------------------------ else - local index = nil; - + local index = nil; -- check timer object buff, index, buffname, bt, charges = SMARTBUFF_CheckUnitBuffs(unit, buffnS, cBuff.Type, cBuff.Links, cBuff.Chain); if (charges == nil) then charges = -1; end @@ -2620,7 +2596,7 @@ function SMARTBUFF_SetMissingBuffMessage(target, buff, icon, bCanCharge, nCharge -- play sound if (O.ToggleAutoSound) then - PlaySound(1141); + PlaySound(Sounds[O.AutoSoundSelection]); end end @@ -3304,8 +3280,7 @@ function SMARTBUFF_Options_Init(self) --AutoSelfCast = GetCVar("autoSelfCast"); SMARTBUFF_PLAYERCLASS = sPlayerClass; - - + if (not SMARTBUFF_Buffs) then SMARTBUFF_Buffs = { }; end B = SMARTBUFF_Buffs; if (not SMARTBUFF_Options) then SMARTBUFF_Options = { }; end @@ -3321,6 +3296,7 @@ function SMARTBUFF_Options_Init(self) if (O.ToggleAutoChat == nil) then O.ToggleAutoChat = false; end if (O.ToggleAutoSplash == nil) then O.ToggleAutoSplash = true; end if (O.ToggleAutoSound == nil) then O.ToggleAutoSound = true; end + if (O.AutoSoundSelection == nil) then O.AutoSoundSelection = 1; end; if (O.CheckCharges == nil) then O.CheckCharges = true; end --if (O.ToggleAutoRest == nil) then O.ToggleAutoRest = true; end if (O.RebuffTimer == nil) then O.RebuffTimer = 20; end @@ -3343,8 +3319,9 @@ function SMARTBUFF_Options_Init(self) if (O.AutoSwitchTemplate == nil) then O.AutoSwitchTemplate = true; end if (O.AutoSwitchTemplateInst == nil) then O.AutoSwitchTemplateInst = true; end if (O.InShapeshift == nil) then O.InShapeshift = true; end + if (O.WarnWhileMounted == nil) then O.WarnWhileMounted = false; end - if (O.ToggleGrp == nil) then O.ToggleGrp = {true, false, false, false, false, false, false, false}; end + if (O.ToggleGrp == nil) then O.ToggleGrp = {true, true, true, true, true, true, true, true}; end if (O.ToggleSubGrpChanged == nil) then O.ToggleSubGrpChanged = false; end if (O.ToggleMsgNormal == nil) then O.ToggleMsgNormal = false; end @@ -3429,8 +3406,7 @@ function SMARTBUFF_Options_Init(self) SMARTBUFF_FindItem("ScanBagsForSBInit"); - SMARTBUFF_AddMsg(SMARTBUFF_VERS_TITLE .. " " .. SMARTBUFF_MSG_LOADED, true); - SMARTBUFF_AddMsg("/sbm - " .. SMARTBUFF_OFT_MENU, true); + DEFAULT_CHAT_FRAME:AddMessage("|cff00e0ff"..SMARTBUFF_VERS_TITLE .. "|cffffffff " .. SMARTBUFF_MSG_LOADED.."|cffFFFF00 /sbm - |cffffffff"..SMARTBUFF_OFT_MENU); isInit = true; SMARTBUFF_CheckMiniMapButton(); @@ -3814,6 +3790,9 @@ function SMARTBUFF_OHideSAButton() O.HideSAButton = not O.HideSAButton; SMARTBUFF_ShowSAButton(); end +function SMARTBUFF_OWarnWhenMountedButton() + O.WarnWhileMounted = not O.WarnWhileMounted; +end function SMARTBUFF_OToggleBuff(s, i) local bs = GetBuffSettings(cBuffs[i].BuffS); @@ -4127,6 +4106,7 @@ function SMARTBUFF_Options_OnShow() SmartBuffOptionsFrame_cbBuffTarget:SetChecked(O.BuffTarget); SmartBuffOptionsFrame_cbBuffInCities:SetChecked(O.BuffInCities); SmartBuffOptionsFrame_cbInShapeshift:SetChecked(O.InShapeshift); + SmartBuffOptionsFrame_cbWarnWhenMounted:SetChecked(O.WarnWhileMounted); SmartBuffOptionsFrame_cbAntiDaze:SetChecked(O.AntiDaze); SmartBuffOptionsFrame_cbLinkGrpBuffCheck:SetChecked(O.LinkGrpBuffCheck); @@ -4627,9 +4607,7 @@ function SMARTBUFF_OnPreClick(self, button, down) td = GlobalCd; end --SMARTBUFF_AddMsgD("Last buff type: " .. lastBuffType .. ", set cd: " .. td); - - - -- *** TODO: Check for classic ********************************************************************************** + local casting = UnitCastingInfo("player") or UnitChannelInfo("player"); --print(casting); if (casting ~= nil) then @@ -5040,19 +5018,3 @@ local HelpPlateList = { function SMARTBUFF_ToggleTutorial(close) end ---[[function SMARTBUFF_ToggleTutorial(close) - local helpPlate = HelpPlateList; - if (not helpPlate) then return end; - - local b = HelpPlate_IsShowing(helpPlate); - if (close) then - HelpPlate_Hide(false); - return; - end - - if (not b) then - HelpPlate_Show(helpPlate, SmartBuffOptionsFrame, SmartBuffOptionsFrame_TutorialButton, true); - else - HelpPlate_Hide(true); - end -end--]] diff --git a/SmartBuff.toc b/SmartBuff.toc index 5222cca..68c2df0 100644 --- a/SmartBuff.toc +++ b/SmartBuff.toc @@ -1,8 +1,8 @@ -## Interface: 20504 -## Title: |TInterface\Addons\Smartbuff\Icons\IconEnabled:0|t SmartBuff |cffffffff(Classic Version)|r -## Version: 33.20504 +## Interface: 30400 +## Title: |TInterface\Addons\Smartbuff\Icons\IconEnabled:0|t SmartBuff |cffffffff(WOTLK Classic)|r +## Version: 34.30400 ## Author: |cff20d2ffCodermik (Mik / Castanova on EU-Mirage Raceway) & Aeldra|r (EU-Proudmoore) -## Notes: Cast the most important buffs on you or party, raid, pets and assigned tanks. Use /sbm for options menu. +## Notes: Cast the most important buffs on you or party, raid, pets and assigned tanks. Use /sbm for options menu. ## DefaultState: Enabled ## LoadOnDemand: 0 ## SavedVariables: SMARTBUFF_OptionsGlobal diff --git a/SmartBuff.xml b/SmartBuff.xml index b08281c..da6dcc6 100644 --- a/SmartBuff.xml +++ b/SmartBuff.xml @@ -868,9 +868,7 @@ - - - + @@ -1240,7 +1238,7 @@ - + @@ -1271,7 +1269,7 @@ - + @@ -1523,6 +1521,83 @@ + + + + + + + + + + + + SmartBuffOptionsFrameSlider_OnLoad(self, 1, 14, 1); + BackdropTemplateMixin.OnBackdropLoaded(self); + + + GameTooltip:Hide(); + + + GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); + GameTooltip:SetText(SMARTBUFF_OFTT_SOUNDSELECT, SMARTBUFF_TTC_R, SMARTBUFF_TTC_G, SMARTBUFF_TTC_B, SMARTBUFF_TTC_A); + + + local o = SMARTBUFF_Options; + local n = self:GetValue(); + if (o and o.AutoSoundSelection ~= n) then + SmartBuff_SetSliderText(self, SMARTBUFF_MSG_SOUNDS, n, "%d"); + o.AutoSoundSelection = n; + end + + + local o = SMARTBUFF_Options; + if (o and o.AutoSoundSelection) then + SmartBuff_SetSliderText(self, SMARTBUFF_MSG_SOUNDS, o.AutoSoundSelection, "%d", true); + end + + + + + + + + + + + + + + + + + + + GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); + GameTooltip:SetText(SMARTBUFF_OFTT_WARNWHILEMOUNTED, SMARTBUFF_TTC_R, SMARTBUFF_TTC_G, SMARTBUFF_TTC_B, SMARTBUFF_TTC_A); + + + SMARTBUFF_OWarnWhenMountedButton(); + + + getglobal(self:GetName().."Text"):SetText(SMARTBUFF_OFT_WARNWHILEMOUNTED); + getglobal(self:GetName().."Text"):SetFontObject(GameFontNormalSmall); + + + GameTooltip:Hide(); + + + diff --git a/localization.cn.lua b/localization.cn.lua index 39877bb..1f45f9e 100644 --- a/localization.cn.lua +++ b/localization.cn.lua @@ -325,6 +325,8 @@ SMARTBUFF_OFT_COMPMODE = "兼容模式"; SMARTBUFF_OFT_MINIGRP = "迷你团队"; SMARTBUFF_OFT_ANTIDAZE = "自动切换守护"; SMARTBUFF_OFT_HIDESABUTTON = "隐藏动作按钮"; +SMARTBUFF_OFT_WARNWHILEMOUNTED = "在坐骑上发出警告"; +SMARTBUFF_OFTT_SOUNDSELECT = "选择所需的飞溅声."; SMARTBUFF_OFT_INCOMBAT = "战斗中触发"; SMARTBUFF_OFT_SMARTDEBUFF = "SmartDebuff"; @@ -363,6 +365,7 @@ SMARTBUFF_OFTT_MINIGRP = "用迷你团队模式显示合理化的团队框 SMARTBUFF_OFTT_ANTIDAZE = "当自己队伍中有成员晕眩时,自动取消猎豹守护/豹群守护。"; SMARTBUFF_OFTT_SPLASHSTYLE = "改变BUFF提示信息的字体。"; SMARTBUFF_OFTT_HIDESABUTTON = "隐藏SmartBuff动作按钮。"; +SMARTBUFF_OFTT_WARNWHILEMOUNTED = "在坐骑时检查并警告丢失的增益。"; SMARTBUFF_OFTT_INCOMBAT = "目前只能用于你自己身上。\n你设定的第一个战斗中可释放的BUFF将在战斗前放置到动作按钮上,\n因此你可以在战斗中施放这个法术。\n警告:战斗中所有逻辑判断都将不可用!"; SMARTBUFF_OFTT_SMARTDEBUFF = "显示SmartDebuff窗口。"; SMARTBUFF_OFTT_SPLASHDURATION= "设定多少秒后提示信息消失。"; @@ -416,6 +419,7 @@ SMARTBUFF_MSG_REBUFF = "你的BUFF:"; SMARTBUFF_MSG_LEFT = "以后消失!"; SMARTBUFF_MSG_CLASS = "职业"; SMARTBUFF_MSG_CHARGES = "次数"; +SMARTBUFF_MSG_SOUNDS = "飞溅声音选择: " -- Support SMARTBUFF_MINIMAP_TT = "左键:选项菜单\n右键:开/关\nAlt+左键:SmartDebuff\n按Shift拖拽:移动按钮"; diff --git a/localization.de.lua b/localization.de.lua index b119140..226fe21 100644 --- a/localization.de.lua +++ b/localization.de.lua @@ -92,6 +92,7 @@ SMARTBUFF_OFT_COMPMODE = "Komp. Modus"; SMARTBUFF_OFT_MINIGRP = "Mini Gruppe"; SMARTBUFF_OFT_ANTIDAZE = "Anti-Daze"; SMARTBUFF_OFT_HIDESABUTTON = "Verberge Action-Knopf"; +SMARTBUFF_OFT_WARNWHILEMOUNTED = "Warnen, während montiert"; SMARTBUFF_OFT_INCOMBAT = "Bufft im Kampf"; SMARTBUFF_OFT_SMARTDEBUFF = "SmartDebuff"; SMARTBUFF_OFT_INSHAPESHIFT = "Verwandelt"; @@ -138,6 +139,8 @@ SMARTBUFF_OFTT_MINIGRP = "Zeigt die Raid-Subgruppen Einstellungen in einem SMARTBUFF_OFTT_ANTIDAZE = "Bricht automatisch den\nAspekt des Geparden/Rudels ab,\nwenn jemand betäubt wird\n(Selbst oder Gruppe)."; SMARTBUFF_OFTT_SPLASHSTYLE = "Wechselt die Schriftart\nder Buff-Meldungen."; SMARTBUFF_OFTT_HIDESABUTTON = "Verbirgt den SmartBuff Action-Knopf."; +SMARTBUFF_OFTT_WARNWHILEMOUNTED = "Überprüfen und warnen Sie vor fehlenden Buffs, während Sie auf einem Reittier sind."; +SMARTBUFF_OFTT_SOUNDSELECT = "Wählen Sie den gewünschten Splash."; SMARTBUFF_OFTT_INCOMBAT = "Funktioniert nur auf dich selbst.\nDer erste Buff, welcher als 'im Kampf'\ngesetzt ist, wird verwendet\nund kann im Kampf benutzt werden.\n!!! Achtung !!!\nSämtliche Buff-Logik ist inaktiv im Kampf!"; SMARTBUFF_OFTT_SMARTDEBUFF = "Zeigt das SmartDebuff Fenster."; SMARTBUFF_OFTT_SPLASHDURATION= "Wieviele Sekunden die Splash Meldung angezeigt wird,\nbevor sie ausgeblendet wird."; @@ -196,6 +199,7 @@ SMARTBUFF_MSG_REBUFF = "ReBuff"; SMARTBUFF_MSG_LEFT = "übrig"; SMARTBUFF_MSG_CLASS = "Klasse"; SMARTBUFF_MSG_CHARGES = "Aufladungen"; +SMARTBUFF_MSG_SOUNDS = "Splash-Sound-Auswahl: " SMARTBUFF_MSG_SPECCHANGED = "Spec gewechselt (%s), lade Buff-Vorlagen..."; -- Support diff --git a/localization.en.lua b/localization.en.lua index 2a467ca..ab11e04 100644 --- a/localization.en.lua +++ b/localization.en.lua @@ -6,11 +6,13 @@ SMARTBUFF_WHATSNEW = "\n\n|cffffffff Whats new:|r\n\n" .." |cffffffffClassic version by Codermik\n" .." Please report any issues on Curse or Discord.|r\n\n\n" - .." Changes in r33:\n\n" - .." * Added additional checking for the daily island\n" - .." K'iru Song buff that causes buffing issues.\n" - .." * Fixed issue with Elixir of Healing Power reported\n" - .." via Discord by Funder - thanks!\n" + .." Changes in r34:\n\n" + .." * Added the ability to change the missing buff\n" + .." sound from the options screen.\n\n" + .." * Added option to warn for missing buffs while\n" + .." you are mounted.\n\n" + .." * Fixed issue with Moonkin form not prompting \n" + .." with missing buff notifications.\n\n" .."\n\n" .." |c0000FF96Many thanks to Chris S. for his donation and\n" .." supporting my addon development.\n\n" @@ -109,6 +111,7 @@ SMARTBUFF_OFT_BUFFINCITIES = "Buff in cities"; SMARTBUFF_OFT_BLDURATION = "Blacklisted"; SMARTBUFF_OFT_ANTIDAZE = "Anti daze"; SMARTBUFF_OFT_HIDESABUTTON = "Hide action button"; +SMARTBUFF_OFT_WARNWHILEMOUNTED = "Warn while mounted"; SMARTBUFF_OFT_INCOMBAT = "Buff in combat"; SMARTBUFF_OFT_SMARTDEBUFF = "SmartDebuff"; SMARTBUFF_OFT_INSHAPESHIFT = "Shapeshift"; @@ -154,6 +157,8 @@ SMARTBUFF_OFTT_BLDURATION = "How many seconds, players will be blacklisted.\n SMARTBUFF_OFTT_ANTIDAZE = "Automatically cancels the\naspect of the cheetah/pack\nif someone gets dazed\n(self or group)."; SMARTBUFF_OFTT_SPLASHSTYLE = "Changes the fontstyle of\nthe buff messages."; SMARTBUFF_OFTT_HIDESABUTTON = "Hides the SmartBuff action button."; +SMARTBUFF_OFTT_WARNWHILEMOUNTED = "Check and warn for missing buffs while you are mounted."; +SMARTBUFF_OFTT_SOUNDSELECT = "Select the required splash sound."; SMARTBUFF_OFTT_INCOMBAT = "At the moment it only works on yourself.\nThe first buff you mark as in combat,\nwill set on the button before combat\nand you can use it in combat.\n!!! Warning !!!\nAll logic is disabled in combat!"; SMARTBUFF_OFTT_SMARTDEBUFF = "Shows the SmartDebuff frame."; SMARTBUFF_OFTT_SPLASHDURATION= "How many seconds the splash\nmessage will displayed,\nbefore it fades."; @@ -188,7 +193,7 @@ SMARTBUFF_BSTT_MANALIMIT = "Mana/Rage/Energy threshold\nIf you are below thi SMARTBUFF_PSTT_RESIZE = "Minimize/maximize\nthe main options frame"; -- Messages -SMARTBUFF_MSG_LOADED = "loaded. Classic version by Codermik - please report any errors found."; +SMARTBUFF_MSG_LOADED = "loaded! - Classic version by Codermik - please report any errors found."; SMARTBUFF_MSG_NEWVER1 = "|cff00e0ffSmartbuff : |cffffffff There is a new version available, you are using |cffFFFF00"; SMARTBUFF_MSG_NEWVER2 = "|cffffffff and revision |cffFFFF00r" SMARTBUFF_MSG_NEWVER3 = "|cffffffff is currently available for download. Join Discord for all the latest information at https://discord.gg/R6EkZ94TKK."; @@ -212,6 +217,7 @@ SMARTBUFF_MSG_REBUFF = "Rebuff"; SMARTBUFF_MSG_LEFT = "left"; SMARTBUFF_MSG_CLASS = "Class"; SMARTBUFF_MSG_CHARGES = "charges"; +SMARTBUFF_MSG_SOUNDS = "Splash Sound Selection: " SMARTBUFF_MSG_SPECCHANGED = "Spec changed (%s), loading buff templates..."; -- Support diff --git a/localization.es.lua b/localization.es.lua index cb59d38..05b2221 100644 --- a/localization.es.lua +++ b/localization.es.lua @@ -90,6 +90,8 @@ SMARTBUFF_OFT_COMPMODE = "Modo Comp."; SMARTBUFF_OFT_MINIGRP = "Mini grupo"; SMARTBUFF_OFT_ANTIDAZE = "Anti aturdimiento"; SMARTBUFF_OFT_HIDESABUTTON = "Ocultar bot\195\179n de acci\195\179n"; +SMARTBUFF_OFT_WARNWHILEMOUNTED = "Advertencia mientras est montado"; +SMARTBUFF_OFTT_SOUNDSELECT = "Select the required splash sound."; SMARTBUFF_OFT_INCOMBAT = "en combate"; SMARTBUFF_OFT_SMARTDEBUFF = "SmartDebuff"; SMARTBUFF_OFT_INSHAPESHIFT = "Shapeshift"; @@ -134,6 +136,8 @@ SMARTBUFF_OFTT_MINIGRP = "Mostrar los ajustes del subgrupo de banda en un\ SMARTBUFF_OFTT_ANTIDAZE = "Autom\195\161ticamente cancela el\naspecto del mono/manada\nsi alguien est\195\161 aturdido\n(\195\169l mismo o el grupo)."; SMARTBUFF_OFTT_SPLASHSTYLE = "Cambia la fuente de\nlos mensajes de buff."; SMARTBUFF_OFTT_HIDESABUTTON = "Oculta el bot\195\179n de acci\195\179n de SmartBuff."; +SMARTBUFF_OFTT_WARNWHILEMOUNTED = "Comprueba y avisa mientras ests montado."; +SMARTBUFF_OFTT_SOUNDSELECT = "Seleccione el sonido de advertencia."; SMARTBUFF_OFTT_INCOMBAT = "De momento s\195\179lo funciona sobre t\195\173 mismo.\nEl primer buff que marcas para combate,\nse establecer\195\161 en el bot\195\179n antes del combate\ny puede ser usado en combate.\nAviso! Toda l\195\179gica se inutiliza en combate"; SMARTBUFF_OFTT_SMARTDEBUFF = "Muestra la pesta\195\177a de SmartDeBuff"; SMARTBUFF_OFTT_SPLASHDURATION= "Cu\195\161ntos segundos estar\195\161 en pantalla el\nmensaje,\nantes de atenuarse."; @@ -192,6 +196,7 @@ SMARTBUFF_MSG_REBUFF = "Rebuff"; SMARTBUFF_MSG_LEFT = "tiempo restante"; SMARTBUFF_MSG_CLASS = "Clase"; SMARTBUFF_MSG_CHARGES = "cargas"; +SMARTBUFF_MSG_SOUNDS = "Seleccin de sonido: " SMARTBUFF_MSG_SPECCHANGED = "Spec changed (%s), loading buff templates..."; -- Support diff --git a/localization.fr.lua b/localization.fr.lua index c3c1cca..2ceb306 100644 --- a/localization.fr.lua +++ b/localization.fr.lua @@ -91,6 +91,8 @@ SMARTBUFF_OFT_COMPMODE = "Comp. mode"; SMARTBUFF_OFT_MINIGRP = "Mini groupe"; SMARTBUFF_OFT_ANTIDAZE = "Anti daze"; -- NOT TRANSLATED SMARTBUFF_OFT_HIDESABUTTON = "Cacher: Bouton action"; +SMARTBUFF_OFT_WARNWHILEMOUNTED = "Avertir sur une monture"; +SMARTBUFF_OFTT_SOUNDSELECT = "Sélectionnez le son d'éclaboussure requis."; SMARTBUFF_OFT_INCOMBAT = "en combat"; SMARTBUFF_OFT_SMARTDEBUFF = "SmartDebuff"; SMARTBUFF_OFT_INSHAPESHIFT = "Shapeshift"; @@ -135,6 +137,7 @@ SMARTBUFF_OFTT_MINIGRP = "Show raid subgoup settings in an\nown movable mi SMARTBUFF_OFTT_ANTIDAZE = "Automatically cancels the\naspect of the cheetah/pack\nif someone gets dazed\n(self or group)."; -- NOT TRANSLATED SMARTBUFF_OFTT_SPLASHSTYLE = "Changes the fontstyle of\nthe buff messages."; -- NOT TRANSLATED SMARTBUFF_OFTT_HIDESABUTTON = "Cache le bouton SmartBuff de action."; -- NOT TRANSLATED +SMARTBUFF_OFTT_WARNWHILEMOUNTED = "Vérifiez et avertissez les buffs manquants pendant que vous êtes sur une monture."; SMARTBUFF_OFTT_INCOMBAT = "At the moment it only works on yourself.\nThe first buff you mark as in combat,\nwill set on the button before combat\nand you can use it in combat.\nWarning! All logic is disabled in combat!"; SMARTBUFF_OFTT_SMARTDEBUFF = "Shows the SmartDebuff frame."; SMARTBUFF_OFTT_SPLASHDURATION= "How many seconds the splash\nmessage will displayed,\nbefore it fades."; @@ -193,6 +196,7 @@ SMARTBUFF_MSG_REBUFF = "Rebuff"; SMARTBUFF_MSG_LEFT = "temps restant"; SMARTBUFF_MSG_CLASS = "Classe"; SMARTBUFF_MSG_CHARGES = "charges"; +SMARTBUFF_MSG_SOUNDS = "Son Splash sélectionné: " SMARTBUFF_MSG_SPECCHANGED = "Spec changed (%s), loading buff templates..."; -- Support diff --git a/localization.ru.lua b/localization.ru.lua index 571c15b..a5575a8 100644 --- a/localization.ru.lua +++ b/localization.ru.lua @@ -89,6 +89,8 @@ SMARTBUFF_OFT_COMPMODE = "Комп.режим"; SMARTBUFF_OFT_MINIGRP = "Мини-группа"; SMARTBUFF_OFT_ANTIDAZE = "Анти-стоп"; SMARTBUFF_OFT_HIDESABUTTON = "Спрятать кнопку действия"; +SMARTBUFF_OFT_WARNWHILEMOUNTED = "Предупреждать, находясь на маунте"; +SMARTBUFF_OFTT_SOUNDSELECT = "Выберите звук всплеска."; SMARTBUFF_OFT_INCOMBAT = "в бою"; SMARTBUFF_OFT_SMARTDEBUFF = "SmartDebuff"; SMARTBUFF_OFT_INSHAPESHIFT = "Shapeshift"; @@ -133,6 +135,7 @@ SMARTBUFF_OFTT_MINIGRP = "Показывать выбор подгрупп SMARTBUFF_OFTT_ANTIDAZE = "Автоматически прерывать\nДух Гепарда/Стаи\nесли на ком-то из группы\nповисло замедление."; SMARTBUFF_OFTT_SPLASHSTYLE = "Изменить шрифт сообщений о баффах."; SMARTBUFF_OFTT_HIDESABUTTON = "Спрятать кнопку действия SmartBuff."; +SMARTBUFF_OFTT_WARNWHILEMOUNTED = "Проверьте и предупредите об отсутствии баффов, пока вы находитесь на ездовом животном."; SMARTBUFF_OFTT_INCOMBAT = "At the moment it only works on yourself.\nThe first buff you mark as in combat,\nwill set on the button before combat\nand you can use it in combat.\nWarning! All logic is disabled in combat!"; SMARTBUFF_OFTT_SMARTDEBUFF = "Shows the SmartDebuff frame."; SMARTBUFF_OFTT_SPLASHDURATION= "Сколько секунд будут отображаться\nвсплывающие сообщения."; @@ -190,6 +193,7 @@ SMARTBUFF_MSG_REBUFF = "Реббафф"; SMARTBUFF_MSG_LEFT = "осталось"; SMARTBUFF_MSG_CLASS = "Класс"; SMARTBUFF_MSG_CHARGES = "зарядов"; +SMARTBUFF_MSG_SOUNDS = "Выбранный звук всплеска: " SMARTBUFF_MSG_SPECCHANGED = "Spec changed (%s), loading buff templates..."; -- Support diff --git a/localization.tw.lua b/localization.tw.lua index 0549cf8..141e4bb 100644 --- a/localization.tw.lua +++ b/localization.tw.lua @@ -93,6 +93,8 @@ SMARTBUFF_OFT_COMPMODE = "相容模式"; SMARTBUFF_OFT_MINIGRP = "小團隊"; SMARTBUFF_OFT_ANTIDAZE = "防眩暈"; SMARTBUFF_OFT_HIDESABUTTON = "隱藏動作按鈕"; +SMARTBUFF_OFT_WARNWHILEMOUNTED = "掛載時發出警告"; +SMARTBUFF_OFTT_SOUNDSELECT = "選擇所需的飛濺聲。"; SMARTBUFF_OFT_INCOMBAT = "戰鬥中"; SMARTBUFF_OFT_SMARTDEBUFF = "SmartDebuff"; SMARTBUFF_OFT_INSHAPESHIFT = "變身型態下"; @@ -140,6 +142,7 @@ SMARTBUFF_OFTT_MINIGRP = "以獨立可移動小視窗顯示Raid各小隊 SMARTBUFF_OFTT_ANTIDAZE = "若小隊中有人眩暈,\n自動取消獵豹/豹群守護"; SMARTBUFF_OFTT_SPLASHSTYLE = "更換 buff 訊息字型."; SMARTBUFF_OFTT_HIDESABUTTON = "隱藏SmartBuff動作按鈕."; +SMARTBUFF_OFTT_WARNWHILEMOUNTED = "在坐騎時檢查並警告丟失的增益."; SMARTBUFF_OFTT_INCOMBAT = "只對自己作用.\n被勾選為'戰鬥中'的第一個buff會在戰鬥前被設定在按鈕上,\n並能在戰鬥中使用.\n注意: 戰鬥中禁用邏輯判斷."; SMARTBUFF_OFTT_SMARTDEBUFF = "顯示SmartDebuff視窗."; SMARTBUFF_OFTT_SPLASHDURATION= "閃爍訊息持續秒數."; @@ -198,6 +201,7 @@ SMARTBUFF_MSG_REBUFF = "Rebuff:"; SMARTBUFF_MSG_LEFT = "剩餘"; SMARTBUFF_MSG_CLASS = "職業"; SMARTBUFF_MSG_CHARGES = "次"; +SMARTBUFF_MSG_SOUNDS = "飛濺聲音選擇: " SMARTBUFF_MSG_SPECCHANGED = "天賦已更改(%s), 重設buff模組..."; -- Support