diff --git a/SVUI_!Core/libs/_SVUI_Lib/LUA.lua b/SVUI_!Core/libs/_SVUI_Lib/LUA.lua index 7333838..df74685 100644 --- a/SVUI_!Core/libs/_SVUI_Lib/LUA.lua +++ b/SVUI_!Core/libs/_SVUI_Lib/LUA.lua @@ -25,10 +25,10 @@ local tinsert = table.insert; local table_sort = table.sort; local string = _G.string; local match = string.match; -local gmatch = string.gmatch; +local gmatch = string.gmatch; local gsub = string.gsub; local rep = string.rep; -local char = string.char; +local char = string.char; local strmatch = _G.strmatch; local bit = _G.bit; local band = bit.band; diff --git a/SVUI_!Core/libs/_SVUI_Lib/Registry.lua b/SVUI_!Core/libs/_SVUI_Lib/Registry.lua index 66b3001..de18eb2 100644 --- a/SVUI_!Core/libs/_SVUI_Lib/Registry.lua +++ b/SVUI_!Core/libs/_SVUI_Lib/Registry.lua @@ -541,26 +541,15 @@ local function CheckForDeprecated(oldKey) end end -local function CheckRealmIntegrity(key) - local newKey = key; - if(not key:find(" - ")) then - newKey = ("%s - %s"):format(playerName, key); - end - if(not GLOBAL_SV.profileRealms[newKey]) then - GLOBAL_SV.profileRealms[newKey] = playerRealm; - elseif(GLOBAL_SV.profileRealms[newKey] ~= playerRealm) then - newKey = ("%s [%s] - %s"):format(playerName, playerRealm, key); - GLOBAL_SV.profileRealms[newKey] = playerRealm; - end - return newKey -end - -local function CheckSavedRealmIntegrity(oldKey) - local safeKey = oldKey; - if(not GLOBAL_SV.profileRealms[oldKey]) then - GLOBAL_SV.profileRealms[oldKey] = playerRealm; - elseif(GLOBAL_SV.profileRealms[oldKey] ~= playerRealm) then - safeKey = ("%s [%s] - %s"):format(playerName, playerRealm, "Default"); +local function GenerateProfileKey(key) + local safeKey = key or PRIVATE_SV.SAFEDATA.CurrentProfile; + if(not safeKey) then safeKey = ("%s - %s"):format(playerName, "Default"); end + if(not GLOBAL_SV.profileRealms[safeKey]) then + GLOBAL_SV.profileRealms[safeKey] = playerRealm; + elseif(GLOBAL_SV.profileRealms[safeKey] ~= playerRealm) then + if(not safeKey:find(playerRealm)) then + safeKey = ("%s [%s] - %s"):format(playerName, playerRealm, "Default"); + end GLOBAL_SV.profileRealms[safeKey] = playerRealm; end PRIVATE_SV.SAFEDATA.CurrentProfile = safeKey @@ -568,37 +557,21 @@ local function CheckSavedRealmIntegrity(oldKey) end local function UpdateProfileSources(newKey) + local SOURCE_KEY = newKey; local PREVIOUS_PROFILE_KEY = PROFILE_KEY; if(PRIVATE_SV.SAFEDATA.DUALSPEC) then local specID = GetSpecialization(); if(specID) then - local _, SOURCE_KEY, _, _, _, _ = GetSpecializationInfo(specID); - if(not SOURCE_KEY) then SOURCE_KEY = "Default" end - --PROFILE_KEY = ("%s [%s] - %s"):format(playerName, playerRealm, SOURCE_KEY) - PROFILE_KEY = CheckRealmIntegrity(SOURCE_KEY) - PRIVATE_SV.SAFEDATA.CurrentProfile = PROFILE_KEY - --CheckForDeprecated(("%s - %s"):format(playerName, SOURCE_KEY)) - elseif(newKey) then - PROFILE_KEY = CheckRealmIntegrity(newKey) - PRIVATE_SV.SAFEDATA.CurrentProfile = PROFILE_KEY - elseif(PRIVATE_SV.SAFEDATA.CurrentProfile) then - PROFILE_KEY = CheckSavedRealmIntegrity(PRIVATE_SV.SAFEDATA.CurrentProfile) - else - PROFILE_KEY = CheckSavedRealmIntegrity("Default") + local _, talentKey, _, _, _, _ = GetSpecializationInfo(specID); + SOURCE_KEY = talentKey or "Default"; end lib.EventManager:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") else - if(newKey) then - PROFILE_KEY = CheckRealmIntegrity(newKey) - PRIVATE_SV.SAFEDATA.CurrentProfile = PROFILE_KEY - elseif(PRIVATE_SV.SAFEDATA.CurrentProfile) then - PROFILE_KEY = CheckSavedRealmIntegrity(PRIVATE_SV.SAFEDATA.CurrentProfile) - else - PROFILE_KEY = CheckSavedRealmIntegrity("Default") - end lib.EventManager:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") end + PROFILE_KEY = GenerateProfileKey(SOURCE_KEY) + if(not GLOBAL_SV.profiles[PROFILE_KEY]) then GLOBAL_SV.profiles[PROFILE_KEY] = {} end if(not GLOBAL_SV.profileKeys[PROFILE_KEY]) then for k,v in pairs(GLOBAL_SV.profiles) do diff --git a/SVUI_!Core/libs/_SVUI_Lib/SpecialFX.lua b/SVUI_!Core/libs/_SVUI_Lib/SpecialFX.lua index eec4306..ca16b16 100644 --- a/SVUI_!Core/libs/_SVUI_Lib/SpecialFX.lua +++ b/SVUI_!Core/libs/_SVUI_Lib/SpecialFX.lua @@ -2,14 +2,14 @@ /$$$$$$ /$$ /$$ /$$$$$$$$ /$$ /$$ /$$__ $$ |__/ | $$| $$_____/| $$ / $$ | $$ \__/ /$$$$$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$ | $$| $$ | $$/ $$/ -| $$$$$$ /$$__ $$ /$$__ $$ /$$_____/| $$ |____ $$| $$| $$$$$ \ $$$$/ - \____ $$| $$ \ $$| $$$$$$$$| $$ | $$ /$$$$$$$| $$| $$__/ >$$ $$ +| $$$$$$ /$$__ $$ /$$__ $$ /$$_____/| $$ |____ $$| $$| $$$$$ \ $$$$/ + \____ $$| $$ \ $$| $$$$$$$$| $$ | $$ /$$$$$$$| $$| $$__/ >$$ $$ /$$ \ $$| $$ | $$| $$_____/| $$ | $$ /$$__ $$| $$| $$ /$$/\ $$ | $$$$$$/| $$$$$$$/| $$$$$$$| $$$$$$$| $$| $$$$$$$| $$| $$ | $$ \ $$ \______/ | $$____/ \_______/ \_______/|__/ \_______/|__/|__/ |__/ |__/ - | $$ - | $$ - |__/ + | $$ + | $$ + |__/ --]] --[[ LOCALIZED GLOBALS ]]-- @@ -62,9 +62,7 @@ if not lib then return end --[[ LIB EFFECT TABLES ]]-- local DEFAULT_MODEL = [[Spells\Missile_bomb.m2]]; - local DEFAULT_EFFECT = {DEFAULT_MODEL, 0, 0, 0, 0, 0.75, 0, 0}; - local EFFECTS_LIST = setmetatable({ ["default"] = {[[Spells\Missile_bomb.m2]], -12, 12, 12, -12, 0.25, 0.125, 0.05}, ["holy"] = {[[Spells\Solar_precast_hand.m2]], -12, 12, 12, -12, 0.23, 0, 0}, @@ -80,6 +78,54 @@ local EFFECTS_LIST = setmetatable({ return DEFAULT_EFFECT end }); +local DEFAULT_ROUTINE = {0, 2000}; +local MODEL_ROUTINES = setmetatable({ + ["idle"] = {0, 2000}, + ["walk"] = {4, 2000}, + ["run"] = {5, 2000}, + ["attack1"] = {26, 2000}, + ["falling"] = {40, 2000}, + ["casting1"] = {52, 2000}, + ["static_roar"] = {55, 2000}, + ["chat"] = {60, 2000}, + ["yell"] = {64, 2000}, + ["shrug"] = {65, 2000}, + ["dance"] = {69, 2000}, + ["roar"] = {74, 2000}, + ["attack2"] = {111, 2000}, + ["sneak"] = {119, 2000}, + ["stealth"] = {120, 2000}, + ["casting2"] = {125, 2000}, + ["crafting"] = {138, 2000}, + ["kneel"] = {141, 2000}, + ["cannibalize"] = {203, 2000}, + ["cower"] = {225, 2000}, +}, { __index = function(t, k) + return DEFAULT_ROUTINE +end }); + +--[[ CHARACTER MODEL METHODS ]]-- + +local CharacterModel_OnUpdate = function(self, elapsed) + if(self.___frameIndex < self.___maxIndex) then + self.___frameIndex = (self.___frameIndex + (elapsed * 1000)); + else + self.___frameIndex = 0; + self:SetAnimation(0); + self:SetScript("OnUpdate", nil); + end +end + +local CharacterModel_UseAnimation = function(self, animationName) + animationName = animationName or self.___currentAnimation; + local effectTable = self.___routines[effectName]; + self.___frameIndex = 0; + self.___maxIndex = effectTable[2]; + self.___currentAnimation = animationName; + self:SetAnimation(effectTable[1]); + self:SetScript("OnUpdate", CharacterModel_OnUpdate); +end + --[[ EFFECT FRAME METHODS ]]-- local EffectModel_SetAnchorParent = function(self, frame) @@ -99,13 +145,9 @@ local EffectModel_UpdateEffect = function(self) end local EffectModel_SetEffect = function(self, effectName) - --print(effectName) - effectName = effectName or self.currentEffect - --print(effectName) + effectName = effectName or self.currentEffect; local effectTable = self.___fx[effectName]; - --print(effectTable[1]) local parent = self.___anchorParent; - self:ClearAllPoints(); self:SetPoint("TOPLEFT", parent, "TOPLEFT", effectTable[2], effectTable[3]); self:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", effectTable[4], effectTable[5]); @@ -114,22 +156,31 @@ local EffectModel_SetEffect = function(self, effectName) self:SetCamDistanceScale(effectTable[6]); self:SetPosition(0, effectTable[7], effectTable[8]); self:SetPortraitZoom(0); - self.currentEffect = effectName; -end +end --[[ LIB METHODS ]]-- -function lib:Register(effectName, modelFile, leftX, leftY, rightX, rightY, zoom, posX, posY) - effectName = effectName:lower(); - modelFile = modelFile or DEFAULT_MODEL; - leftX = leftX or 0; - leftY = leftY or 0; - rightX = rightX or 0; - rightY = rightY or 0; - zoom = zoom or 0.75; - posX = posX or 0; - posY = posY or 0; - rawset(EFFECTS_LIST, effectName, {modelFile, leftX, leftY, rightX, rightY, zoom, posX, posY}) + +function lib:Register(request, modelFile, leftX, leftY, rightX, rightY, zoom, posX, posY) + if(type(request) == 'string') then + request = request:lower(); + modelFile = modelFile or DEFAULT_MODEL; + leftX = leftX or 0; + leftY = leftY or 0; + rightX = rightX or 0; + rightY = rightY or 0; + zoom = zoom or 0.75; + posX = posX or 0; + posY = posY or 0; + rawset(EFFECTS_LIST, request, {modelFile, leftX, leftY, rightX, rightY, zoom, posX, posY}) + elseif(request.SetAnimation) then + request.___routines = {}; + setmetatable(request.___routines, { __index = ANIMATION_IDS }); + request.___frameIndex = 0; + request.___maxIndex = 2000; + request.___currentAnimation = "idle"; + request.UseAnimation = CharacterModel_UseAnimation; + end end; function lib:SetFXFrame(parent, defaultEffect, noScript, anchorParent) @@ -208,9 +259,7 @@ end -- [[Spells\Warlock_destructioncharge_impact_chest_fel.m2]] -- [[Spells\Xplosion_twilight_impact_noflash.m2]] -- [[Spells\Warlock_bodyofflames_medium_state_shoulder_right_purple.m2]] - -- [[Spells\Blink_impact_chest.m2]] - -- [[Spells\Christmassnowrain.m2]] -- [[Spells\Detectinvis_impact_base.m2]] -- [[Spells\Eastern_plaguelands_beam_effect.m2]] @@ -243,4 +292,4 @@ end -- [[Spells\Solar_precast_hand.m2]] -- [[Spells\Twilight_fire_precast_high_hand.m2]] -- [[Spells\Vengeance_state_hand.m2]] --- [[Spells\Fel_djinndeath_fire_02.m2]] \ No newline at end of file +-- [[Spells\Fel_djinndeath_fire_02.m2]] diff --git a/SVUI_!Core/system/funstuff.lua b/SVUI_!Core/system/funstuff.lua index 423fc2b..0b1a830 100644 --- a/SVUI_!Core/system/funstuff.lua +++ b/SVUI_!Core/system/funstuff.lua @@ -205,30 +205,6 @@ local Start_AFK_Widget = function() DoEmote("READ") end --- function SV.AFK:Activate(enabled) --- if(InCombatLockdown()) then return end --- if(enabled) then --- local sequence = random(1, 4); --- if(SV.db.FunStuff.afk == '1') then --- MoveViewLeftStart(0.05); --- end --- self:SetScript("OnMouseDown", Kill_AFK_Widget) --- self:Show(); --- UIParent:Hide(); --- self:SetAlpha(1); --- self.Model:SetAnimation(AFK_SEQUENCES[sequence]) --- DoEmote("READ") --- else --- self:SetScript("OnMouseDown", nil) --- UIParent:Show(); --- self:SetAlpha(0); --- self:Hide(); --- if(SV.db.FunStuff.afk == '1') then --- MoveViewLeftStop(); --- end --- end --- end - local AFK_OnEvent = function(self, event) if(event == "PLAYER_FLAGS_CHANGED") then if(IsChatAFK() or UnitIsAFK("player")) then @@ -512,7 +488,9 @@ SV.GameMenu = _G["SVUI_GameMenuFrame"]; 40 - falling loop 52 - casting loop 55 - roar pose (paused) -65 - shrug +60 - chat normal +64 - chat exclaimation +65 - chat shrug 69 - dance 74 - roar 111 - attack ready diff --git a/SVUI_QuestTracker/components/quests.lua b/SVUI_QuestTracker/components/quests.lua index a8b9e0a..c739826 100644 --- a/SVUI_QuestTracker/components/quests.lua +++ b/SVUI_QuestTracker/components/quests.lua @@ -117,11 +117,10 @@ do end local Button_OnEnter = function(self) - if(MOD.DOCK_IS_FADED) then return end - if(self.itemID) then - GameTooltip:SetOwner(self, 'ANCHOR_LEFT') - GameTooltip:SetHyperlink(self.itemLink) - end + if(self.itemID and (not MOD.DOCK_IS_FADED)) then + GameTooltip:SetOwner(self, 'ANCHOR_LEFT') + GameTooltip:SetHyperlink(self.itemLink) + end end local Button_OnLeave = function(self) @@ -141,17 +140,14 @@ do end local Button_SetItem = function(self, itemLink, texture, completed) - if(completed) then - self:ClearUsage() - return - end + if(completed) then self:ClearUsage() return end if(itemLink) then if(ACTIVE_ITEMS[itemLink] or ((itemLink == self.itemLink) and self:IsShown())) then return end ACTIVE_ITEMS[itemLink] = self:GetID(); self.Icon:SetTexture(texture) - self.itemID, self.itemName = string.match(itemLink, '|Hitem:(.-):.-|h%[(.+)%]|h') + self.itemID, self.attribute = string.match(itemLink, '|Hitem:(.-):.-|h%[(.+)%]|h') self.itemLink = itemLink if(ItemBlacklist[self.itemID]) then @@ -161,10 +157,9 @@ do end if(InCombatLockdown()) then - self.attribute = self.itemName self:RegisterEvent('PLAYER_REGEN_ENABLED') else - self:SetAttribute('item', self.itemName) + self:SetAttribute('item', self.attribute) self:UpdateCooldown() end @@ -172,63 +167,63 @@ do end local Button_ClearItem = function(self) + self.attribute = nil; if(InCombatLockdown()) then - self.attribute = nil; self:RegisterEvent('PLAYER_REGEN_ENABLED'); else - self:SetAttribute('item', nil) + self:SetAttribute('item', self.attribute) end end local Button_UpdateItem = function(self) - local numItems = 0 - local shortestDistance = 62500 - local closestQuestLink, closestQuestTexture - local activeQuestLink, activeQuestTexture - - for index = 1, GetNumQuestWatches() do - local questID, _, questIndex, _, _, isComplete = GetQuestWatchInfo(index) - if(questID and QuestHasPOIInfo(questID)) then - local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questIndex) - if(link) then - local areaID = QuestInZone[questID] - if questIndex == MOD.CurrentQuest then - activeQuestLink = link - activeQuestTexture = texture - end - if(areaID and areaID == GetCurrentMapAreaID()) then - closestQuestLink = link - closestQuestTexture = texture - elseif(not isComplete or (isComplete and showCompleted)) then - local distanceSq, onContinent = GetDistanceSqToQuest(questIndex) - if(onContinent and distanceSq < shortestDistance) then - shortestDistance = distanceSq + local numItems = 0 + local shortestDistance = 62500 + local closestQuestLink, closestQuestTexture + local activeQuestLink, activeQuestTexture + + for index = 1, GetNumQuestWatches() do + local questID, _, questIndex, _, _, isComplete = GetQuestWatchInfo(index) + if(questID and QuestHasPOIInfo(questID)) then + local link, texture, _, showCompleted = GetQuestLogSpecialItemInfo(questIndex) + if(link) then + local areaID = QuestInZone[questID] + if questIndex == MOD.CurrentQuest then + activeQuestLink = link + activeQuestTexture = texture + end + if(areaID and areaID == GetCurrentMapAreaID()) then closestQuestLink = link closestQuestTexture = texture + elseif(not isComplete or (isComplete and showCompleted)) then + local distanceSq, onContinent = GetDistanceSqToQuest(questIndex) + if(onContinent and distanceSq < shortestDistance) then + shortestDistance = distanceSq + closestQuestLink = link + closestQuestTexture = texture + end end - end - numItems = numItems + 1 + numItems = numItems + 1 + end end end - end - if(closestQuestLink) then - self:SetUsage(closestQuestLink, closestQuestTexture); - elseif(activeQuestLink) then - self:SetUsage(activeQuestLink, activeQuestTexture); - end + if(closestQuestLink) then + self:SetUsage(closestQuestLink, closestQuestTexture); + elseif(activeQuestLink) then + self:SetUsage(activeQuestLink, activeQuestTexture); + end - local name = self:GetName(); - if(numItems > 0 and not TICKERS[name]) then - TICKERS[name] = C_Timer.NewTicker(30, function() - self:Update() - end) - elseif(numItems == 0 and TICKERS[name]) then - TICKERS[name]:Cancel() - TICKERS[name] = nil + local name = self:GetName(); + if(numItems > 0 and not TICKERS[name]) then + TICKERS[name] = C_Timer.NewTicker(30, function() + self:Update() + end) + elseif(numItems == 0 and TICKERS[name]) then + TICKERS[name]:Cancel() + TICKERS[name] = nil + end end - end --[[ METHOD ]]-- @@ -293,21 +288,20 @@ do local savedIndex = ACTIVE_ITEMS[itemLink] if(savedIndex and self.Buttons[savedIndex]) then self.Buttons[savedIndex]:SetUsage(itemLink, texture, completed) - return - end + else + local maxIndex = #self.Buttons; + for i = 1, maxIndex do + if(not self.Buttons[i]:GetAttribute('item')) then + self.Buttons[i]:SetUsage(itemLink, texture, completed) + return + end + end - local maxIndex = #self.Buttons; - for i = 1, maxIndex do - if(not self.Buttons[i]:GetAttribute('item')) then - self.Buttons[i]:SetUsage(itemLink, texture, completed) - return - end + local index = maxIndex + 1 + self.Buttons[index] = CreateQuestItemButton(index) + self.Buttons[index]:SetUsage(itemLink, texture, completed) + end end - - local index = maxIndex + 1 - self.Buttons[index] = CreateQuestItemButton(index) - self.Buttons[index]:SetUsage(itemLink, texture, completed) - end end function ItemBar:Reset() @@ -436,11 +430,6 @@ function ItemBar:Update() end end - -- wipe(ACTIVE_ITEMS); - -- for k,v in pairs(SWAP_ITEMS) do - -- ACTIVE_ITEMS[k] = v - -- end - self.needsUpdate = nil end --[[ diff --git a/SVUI_UnitFrames/Loader.lua b/SVUI_UnitFrames/Loader.lua index 18309b4..c69b9b9 100644 --- a/SVUI_UnitFrames/Loader.lua +++ b/SVUI_UnitFrames/Loader.lua @@ -274,9 +274,12 @@ SV.defaults[Schema] = { ["inset"] = "inset", ["height"] = 25, ["detachFromFrame"] = false, + ["enableStagger"] = true, + ["enableAltMana"] = true, + ["enableCat"] = true, + ["enableChicken"] = true, ["altRunes"] = false, ["altComboPoints"] = false, - ["altStagger"] = false, }, ["icons"] = { diff --git a/SVUI_UnitFrames/class_resources/druid.lua b/SVUI_UnitFrames/class_resources/druid.lua index a030949..866c37d 100644 --- a/SVUI_UnitFrames/class_resources/druid.lua +++ b/SVUI_UnitFrames/class_resources/druid.lua @@ -95,10 +95,13 @@ local OnMove = function() end local Reposition = function(self) - local bar = self.Druidness - local chicken = bar.Chicken; local db = SV.db.UnitFrames.player + local bar = self.Druidness; if not bar or not db then print("Error") return end + self.Druidness.Chicken.isEnabled = db.classbar.enableChicken; + self.Druidness.Mana.isEnabled = db.classbar.enableAltMana; + self.Druidness.Cat.isEnabled = db.classbar.enableCat; + local chicken = bar.Chicken; local height = db.classbar.height local offset = (height - 10) local adjustedBar = (height * 1.5) diff --git a/SVUI_UnitFrames/class_resources/monk.lua b/SVUI_UnitFrames/class_resources/monk.lua index 04c278a..a89025f 100644 --- a/SVUI_UnitFrames/class_resources/monk.lua +++ b/SVUI_UnitFrames/class_resources/monk.lua @@ -1,7 +1,7 @@ --[[ ########################################################## S V U I By: Munglunch -########################################################## +########################################################## LOCALIZED LUA FUNCTIONS ########################################################## ]]-- @@ -20,8 +20,8 @@ local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; ---[[ -########################################################## +--[[ +########################################################## GET ADDON DATA ########################################################## ]]-- @@ -30,7 +30,7 @@ local L = SV.L; local LSM = _G.LibStub("LibSharedMedia-3.0") local MOD = SV.UnitFrames -if(not MOD) then return end +if(not MOD) then return end local oUF_SVUI = MOD.oUF assert(oUF_SVUI, "SVUI UnitFrames: unable to locate oUF.") @@ -53,8 +53,8 @@ local CHI_COORDS = { [5] = {0.5,1,0,0.5}, [6] = {0,0.5,0.5,1}, }; ---[[ -########################################################## +--[[ +########################################################## POSITIONING ########################################################## ]]-- @@ -64,6 +64,7 @@ end local Reposition = function(self) local db = SV.db.UnitFrames.player + self.KungFu.DrunkenMaster.isEnabled = db.classbar.enableStagger; local bar = self.KungFu; local max = self.MaxClassPower; local size = db.classbar.height @@ -86,18 +87,18 @@ local Reposition = function(self) bar[i]:SetHeight(size) bar[i]:SetWidth(size) bar[i]:SetStatusBarColor(chi, 0.87, 0.35) - if i==1 then + if i==1 then bar[i]:SetPoint("TOPLEFT", bar, "TOPLEFT", 0, 0) - else - bar[i]:SetPoint("LEFT", bar[i - 1], "RIGHT", -2, 0) + else + bar[i]:SetPoint("LEFT", bar[i - 1], "RIGHT", -2, 0) end - end -end + end +end local StartFlash = function(self) SV.Animate:Flash(self.overlay,1,true) end local StopFlash = function(self) SV.Animate:StopFlash(self.overlay) end ---[[ -########################################################## +--[[ +########################################################## MONK HARMONY ########################################################## ]]-- @@ -120,7 +121,7 @@ function MOD:CreateClassBar(playerFrame) bar[i].glow:SetAllPoints(bar[i]) bar[i].glow:SetTexture(CHI_FILE) bar[i].glow:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) - + bar[i].overlay = bar[i]:CreateTexture(nil, "OVERLAY", nil, 7) bar[i].overlay:SetAllPoints(bar[i]) bar[i].overlay:SetTexture(CHI_FILE) @@ -169,5 +170,5 @@ function MOD:CreateClassBar(playerFrame) playerFrame.RefreshClassBar = Reposition playerFrame.KungFu = bar - return 'KungFu' -end \ No newline at end of file + return 'KungFu' +end diff --git a/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua b/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua index 974c583..b19bab3 100644 --- a/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua +++ b/SVUI_UnitFrames/libs/Plugins/oUF_Druidness/oUF_Druidness.lua @@ -49,6 +49,11 @@ local TextColors = { [5]={0.1,1,0.1} }; +local ProxyShow = function(self) + if(not self.isEnabled) then return end + self:Show() +end + local UpdateAura = function(self, event, unit) if(unit and unit ~= "player") then return end local chicken = self.Druidness.Chicken @@ -73,7 +78,7 @@ end local function CatOverMana(mana, form) if mana.ManaBar:GetValue() < UnitPowerMax('player', SPELL_POWER_MANA) then - mana:Show() + mana:ProxyShow() return false else mana:Hide() @@ -90,7 +95,7 @@ local UpdateVisibility = function(self, event) if(form) then if(form == MOONKIN_FORM) then - chicken:Show() + chicken:ProxyShow() mana:Hide() cat:Hide() self:RegisterEvent('UNIT_AURA', UpdateAura) @@ -100,7 +105,7 @@ local UpdateVisibility = function(self, event) if (form == BEAR_FORM or form == CAT_FORM) then if(CatOverMana(mana, form)) then - cat:Show() + cat:ProxyShow() else cat:Hide() end @@ -112,7 +117,7 @@ local UpdateVisibility = function(self, event) else local ptt = GetSpecialization() if(ptt and ptt == 1) then -- player has balance spec - chicken:Show() + chicken:ProxyShow() self:RegisterEvent('UNIT_AURA', UpdateAura) else chicken:Hide() @@ -246,10 +251,14 @@ local function Enable(self) local bar = self.Druidness if(bar) then - local chicken = bar.Chicken - local mana = bar.Mana - chicken.__owner = self - chicken.ForceUpdate = ForceUpdate + local chicken = bar.Chicken; + local mana = bar.Mana; + local cpoints = bar.Cat; + chicken.__owner = self; + chicken.ForceUpdate = ForceUpdate; + chicken.ProxyShow = ProxyShow; + mana.ProxyShow = ProxyShow; + cpoints.ProxyShow = ProxyShow; if(chicken.LunarBar and chicken.LunarBar:IsObjectType'StatusBar' and not chicken.LunarBar:GetStatusBarTexture()) then chicken.LunarBar:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]]) diff --git a/SVUI_UnitFrames/libs/Plugins/oUF_KungFu/oUF_KungFu.lua b/SVUI_UnitFrames/libs/Plugins/oUF_KungFu/oUF_KungFu.lua index b6fb2b9..3cde5ec 100644 --- a/SVUI_UnitFrames/libs/Plugins/oUF_KungFu/oUF_KungFu.lua +++ b/SVUI_UnitFrames/libs/Plugins/oUF_KungFu/oUF_KungFu.lua @@ -73,7 +73,7 @@ else DM_L["Light Stagger"] = "Light Stagger" DM_L["Moderate Stagger"] = "Moderate Stagger" DM_L["Heavy Stagger"] = "Heavy Stagger" -end +end local STANCE_OF_THE_STURY_OX_ID = 23; local DEFAULT_BREW_COLOR = {0.91, 0.75, 0.25, 0.5}; @@ -95,7 +95,7 @@ local STAGGER_DEBUFFS = { }; local CURRENT_STAGGER_COLOR = {1, 1, 1, 0.5}; local CURRENT_BREW_COLOR = {0.91, 0.75, 0.25, 0.5}; -local CHI_COLORS = { +local CHI_COLORS = { [1] = {.57, .63, .35, 1}, [2] = {.47, .63, .35, 1}, [3] = {.37, .63, .35, 1}, @@ -106,10 +106,10 @@ local CHI_COLORS = { local function getStaggerAmount() for i = 1, 40 do - local _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, amount = + local _, _, _, _, _, _, _, _, _, _, spellID, _, _, _, amount = UnitDebuff("player", i) if STAGGER_DEBUFFS[spellID] then - if (spellID) then + if (spellID) then CURRENT_STAGGER_COLOR = STAGGER_COLORS[spellID] or DEFAULT_STAGGER_COLOR CURRENT_BREW_COLOR = BREW_COLORS[spellID] or DEFAULT_BREW_COLOR else @@ -142,13 +142,13 @@ local Update = function(self, event, unit) end end end - + if UnitHasVehicleUI("player") then bar:Hide() else bar:Show() end - + if bar.numPoints ~= numPoints then if numPoints == 6 then bar[5]:Show() @@ -161,7 +161,7 @@ local Update = function(self, event, unit) bar[6]:Hide() end end - + bar.numPoints = numPoints if(stagger:IsShown()) then @@ -199,18 +199,18 @@ local Update = function(self, event, unit) end end end - + if(bar.PostUpdate) then bar:PostUpdate(event) end end local Visibility = function(self, ...) local bar = self.KungFu local stagger = bar.DrunkenMaster - if(STANCE_OF_THE_STURY_OX_ID ~= GetShapeshiftFormID() or UnitHasVehiclePlayerFrameUI("player")) then - if stagger:IsShown() then + if((not stagger.isEnabled) or STANCE_OF_THE_STURY_OX_ID ~= GetShapeshiftFormID() or UnitHasVehiclePlayerFrameUI("player")) then + if(stagger:IsShown()) then stagger:Hide() - self:UnregisterEvent('UNIT_AURA', Update) end + self:UnregisterEvent('UNIT_AURA', Update) else stagger:Show() self:RegisterEvent('UNIT_AURA', Update) @@ -240,12 +240,12 @@ local function Enable(self, unit) self:RegisterEvent("PLAYER_LEVEL_UP", Update) self:RegisterEvent('UNIT_DISPLAYPOWER', Path) self:RegisterEvent('UPDATE_SHAPESHIFT_FORM', Path) - + for i = 1, 6 do if not bar[i]:GetStatusBarTexture() then bar[i]:SetStatusBarTexture([=[Interface\TargetingFrame\UI-StatusBar]=]) end - + bar[i]:SetStatusBarColor(unpack(CHI_COLORS[i])) bar[i]:SetFrameLevel(bar:GetFrameLevel() + 1) bar[i]:GetStatusBarTexture():SetHorizTile(false) @@ -264,7 +264,7 @@ local function Enable(self, unit) MonkStaggerBar:UnregisterEvent'PLAYER_SPECIALIZATION_CHANGED' MonkStaggerBar:UnregisterEvent'UNIT_DISPLAYPOWER' MonkStaggerBar:UnregisterEvent'UPDATE_VEHICLE_ACTION_BAR' - + return true end end @@ -286,4 +286,4 @@ local function Disable(self) end end -oUF:AddElement('KungFu', Update, Enable, Disable) \ No newline at end of file +oUF:AddElement('KungFu', Update, Enable, Disable)